Alonexc opened a new issue, #2974:
URL: https://github.com/apache/incubator-eventmesh/issues/2974

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Enhancement Request
   
   
![image](https://user-images.githubusercontent.com/91315508/215702039-0b3b2bb3-d2df-4c63-b9ea-61a07d611e94.png)
   
![image](https://user-images.githubusercontent.com/91315508/215702053-f3bced1b-8cfd-4f32-838e-58714b6f246a.png)
   located at:
   
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/producer/CloudEventProducer.java
 line 60,72,81,88,97,103
   analysis and explanation:
   1. This method uses an SLF4J or Log4j2 logger to log a string, where the 
first (format) string is created using concatenation. You should use {} markers 
to inject dynamic content into the string, so that String building is delayed 
until the actual log string is needed. If the log level is high enough that 
this log statement isn't used, then the appends will never be executed.
   2. This method concatenates the output of a toString() call into a 
StringBuffer or StringBuilder. It is simpler just to pass the object you want 
to append to the append call, as that form does not suffer the potential for 
NullPointerExceptions, and is easier to read.
   
   
   ### Describe the solution you'd like
   
   Proper use of SLF4J for logging information, and removal of .toString to 
avoid NPE.
   e.g.
   
![image](https://user-images.githubusercontent.com/91315508/215702134-8052c543-2459-4da8-ab71-b890db0aa075.png)
   
![image](https://user-images.githubusercontent.com/91315508/215702147-e6ba7c56-c119-46e7-bc87-10b9319f953c.png)
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


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