ppkarwasz commented on code in PR #4698:
URL: https://github.com/apache/eventmesh/pull/4698#discussion_r1438444980


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/codec/Codec.java:
##########
@@ -171,7 +169,7 @@ private Object parseBody(ByteBuf in, Header header, int 
bodyLength) throws JsonP
             }
             final byte[] bodyData = new byte[bodyLength];
             in.readBytes(bodyData);
-            LogUtils.debug(log, "Decode bodyJson={}", 
deserializeBytes(bodyData));
+            log.atDebug().log("Decode bodyJson={}", 
deserializeBytes(bodyData));

Review Comment:
   ```suggestion
               log.atDebug().addArgument(() -> 
deserializeBytes(bodyData)).log("Decode bodyJson={}");
   ```
   
   Same as above.



##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/codec/Codec.java:
##########
@@ -161,7 +159,7 @@ private Header parseHeader(ByteBuf in, int headerLength) 
throws JsonProcessingEx
             }
             final byte[] headerData = new byte[headerLength];
             in.readBytes(headerData);
-            LogUtils.debug(log, "Decode headerJson={}", 
deserializeBytes(headerData));
+            log.atDebug().log("Decode headerJson={}", 
deserializeBytes(headerData));

Review Comment:
   ```suggestion
               log.atDebug().addArgument(() -> 
deserializeBytes(headerData)).log("Decode headerJson={}");
   ```
   
   Since the purpose of your PR is to prevent expensive computations of 
disabled log statement arguments, you should use a lambda here.



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