nicoloboschi commented on code in PR #3764:
URL: https://github.com/apache/bookkeeper/pull/3764#discussion_r1094442986


##########
stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKAsyncLogReader.java:
##########
@@ -364,7 +364,9 @@ private boolean checkClosedOrInError(String operation) {
 
         Throwable cause = lastExceptionUpdater.get(this);
         if (null != cause) {
-            LOG.trace("Cancelling pending reads");
+            if (LOG.isTraceEnabled()) {

Review Comment:
   I think it's fine to leave the logging libraries to perform optimization if 
needed.
   In this case there's no improvement.
   Also, the code is less readable
   
   It's fine to have cases where we check if some level is enabled to not 
perform values computation if not needed but in general it's not a good 
practice to guard every logging call 



-- 
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]

Reply via email to