You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/10/18 08:35:17 UTC

[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #12390: [Improvement-5918]Remove the code logger.isDebugEnabled()

ruanwenjun commented on code in PR #12390:
URL: https://github.com/apache/dolphinscheduler/pull/12390#discussion_r997895787


##########
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java:
##########
@@ -187,9 +187,7 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc
             heartBeat.setBody(heartBeatData);
             ctx.channel().writeAndFlush(heartBeat)
                     .addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
-            if (logger.isDebugEnabled()) {
-                logger.debug("Client send heart beat to: {}", ChannelUtils.getRemoteAddress(ctx.channel()));
-            }
+            logger.debug("Client send heart beat to: {}", ChannelUtils.getRemoteAddress(ctx.channel()));

Review Comment:
   In fact, I don't agree with remove `logger.isDebugEnabled` here, use `logger.debug` will need to calculate `ChannelUtils.getRemoteAddress(ctx.channel())` in each log, but in most of times we don't open debug, we don't need to calculate this.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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