gnodet commented on code in PR #299:
URL: https://github.com/apache/maven-resolver/pull/299#discussion_r1226865171


##########
maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/support/NamedLockFactorySupport.java:
##########
@@ -34,6 +35,8 @@
 public abstract class NamedLockFactorySupport implements NamedLockFactory {
     protected final Logger logger = LoggerFactory.getLogger(getClass());
 
+    final boolean diagnostic = logger.isDebugEnabled();

Review Comment:
   That's a bad idea.  Loggers level can be updated at runtime, and the call to 
`isDebugEnabled()` should be quite enough to not warrant caching the value.



##########
maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/support/NamedLockFactorySupport.java:
##########
@@ -34,6 +35,8 @@
 public abstract class NamedLockFactorySupport implements NamedLockFactory {
     protected final Logger logger = LoggerFactory.getLogger(getClass());
 
+    final boolean diagnostic = logger.isDebugEnabled();

Review Comment:
   That's a bad idea.  Loggers level can be updated at runtime, and the call to 
`isDebugEnabled()` should be fast enough to not warrant caching the value.



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to