-
Notifications
You must be signed in to change notification settings - Fork 9
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
Migration to SLF4J #22
Conversation
Use of SLF4J logger instead of System.(out|err).println()
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.
I ask you to remove all if (LOGGER.isDebugEnabled())
wrappers since it is not necessary anymore with the logging framework in place...
src/main/java/com/siemens/ct/exi/grammars/EXIContentModelBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/siemens/ct/exi/grammars/EXIContentModelBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/siemens/ct/exi/grammars/regex/RangeToken.java
Outdated
Show resolved
Hide resolved
src/main/java/com/siemens/ct/exi/grammars/regex/RangeToken.java
Outdated
Show resolved
Hide resolved
src/main/java/com/siemens/ct/exi/grammars/regex/RangeToken.java
Outdated
Show resolved
Hide resolved
Hi @danielpeintner, checking the log level before logging is a "best practice" to avoid memory allocation, string concatenation, for nothing... This rule is raised by several tools such as SonarQube https://rules.sonarsource.com/java/RSPEC-2629 |
I don't have a very strong opinion but I guess we both can agree that the code looks nicer and less messy without this is additional Moreover, with the formatting style of It would be different if we do something like the following see also some information here: https://logging.apache.org/log4j/log4j-2.3.2/performance.html Anyhow, as I said, IF YOU STRONGLY PREFER to keep it as is I will not argue strongly... :) |
All debug level checks removed |
Use of SLF4J logger instead of System.(out|err).println()