jbertram commented on PR #4387: URL: https://github.com/apache/activemq-artemis/pull/4387#issuecomment-1455477920
Since moving to SLF4J and adopting a new logging pattern we've eliminated almost all of the invocations of `isDebugEnabled`, `isTraceEnabled`, etc. due to the fact that the new pattern uses invocations like `debug(String format, Object... arguments)` and this _already_ implements lazy init. As noted in [the JavaDoc for SLF4J](https://www.slf4j.org/apidocs/org/slf4j/Logger.html#debug-java.lang.String-java.lang.Object...-), e.g.: > This form avoids superfluous string concatenation when the logger is disabled for the DEBUG level. The reason `isDebugEnabled` is still used in the instance you cited is that it doesn't follow this normal pattern and furthermore uses `new Exception("trace")` which is especially costly in terms of performance. If you follow the pattern outlined in my previous comment I think the code will be simpler, more readable, more consistent with the rest of the code-base, and essentially equivalent in terms of performance. I'm not sure what you mean by "boyscout out". -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
