-
Notifications
You must be signed in to change notification settings - Fork 459
removed redundant check of logger level #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #883 +/- ##
============================================
+ Coverage 48.58% 50.18% +1.59%
- Complexity 2803 2813 +10
============================================
Files 118 118
Lines 27868 27022 -846
Branches 4640 4241 -399
============================================
+ Hits 13541 13562 +21
+ Misses 12131 11512 -619
+ Partials 2196 1948 -248
Continue to review full report at Codecov.
|
|
Please remove unused imports from all files, I noticed some files still contain unnecessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good idea!
You are creating a new String by the concatenation of the other strings even if the log is not FINE!
and you are executing the unnecessary logic of toString() as well.
When you are using a log framework that allows wildcard like this
log.debug("My message is {} and don't create unecessary string. Message 2 {}", myStringA, myStringB, ...)You won't create unnecessary string, but if you use methods you will execute them even when the loglevel is not that one and that is not a good idea. When you have method is better to use previous code. If you concatenate string as well.
There are case that NOW will execute string concatenations, getClass(), exception.getMessage() unnecessarily.
A JDBC Driver Should be as fast as possible and avoid every unnecessary resource!
I got two references of the same survey that is based on Git repositories:
http://blog.logscape.com/2017/03/concatenation-or-parameters-both-whats-the-top-method-of-java-logging/
https://blog.takipi.com/whats-the-top-java-logging-method-on-github-string-concatenation-vs-parameterized-logging/
This reverts commit 25028fb.
|
hi @jardelnovaes |
* removed redundant check of logger level * removed redundant check of logger level * removed unused imports * resolved conflicts
No description provided.