You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/12/08 14:02:06 UTC

[GitHub] [incubator-eventmesh] horoc commented on a diff in pull request #2492: [ISSUE #2491] runtime module client subpackage pmd warning

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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org