horoc commented on code in PR #2492:
URL: 
https://github.com/apache/incubator-eventmesh/pull/2492#discussion_r1043387305


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/TcpClient.java:
##########
@@ -104,9 +106,10 @@ public void initChannel(SocketChannel ch) {
         ChannelFuture f = bootstrap.connect(host, port).sync();
         InetSocketAddress localAddress = (InetSocketAddress) 
f.channel().localAddress();
         channel = f.channel();
-        log
-                .info("connected|local={}:{}|server={}", 
localAddress.getAddress().getHostAddress(), localAddress.getPort(),
-                        host + ":" + port);
+        if (LOGGER.isInfoEnabled()) {
+            LOGGER.info("connected|local={}:{}|server={}", 
localAddress.getAddress().getHostAddress(),
+                    localAddress.getPort(), host + ":" + port);

Review Comment:
   Hi, may I know why do we need to check log level here, as far as I know the 
`LOGGER.info`  method has already checked the log level.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to