Copilot commented on code in PR #235:
URL: https://github.com/apache/skywalking-go/pull/235#discussion_r2375817448


##########
tools/go-agent/instrument/logger/frameworks/logrus_adapt.go:
##########
@@ -22,12 +22,18 @@ import (
 )
 
 func UpdateLogrusLogger(l *logrus.Logger) {
-       if LogTracingContextEnable {
-               if _, wrapperd := l.Formatter.(*WrapFormat); !wrapperd {
-                       l.Formatter = Wrap(l.Formatter, LogTracingContextKey)
-               }
-       }
-       ChangeLogger(NewLogrusAdapter(l))
+    if l == nil {
+        return
+    }
+    

Review Comment:
   [nitpick] The empty line after the return statement is unnecessary and 
inconsistent with the formatting of the rest of the function. Consider removing 
it for better code consistency.
   ```suggestion
   
   ```



##########
tools/go-agent/instrument/logger/context.go:
##########
@@ -79,12 +79,15 @@ func (span *NoopSpan) GetEndPointName() string {
 }
 
 func GetLogContext(withEndpoint bool) interface{} {
-       report, ok := GetOperator().LogReporter().(LogReporter)
-       if !ok || report == nil {
-               return nil
-       }
-
-       return report.GetLogContext(withEndpoint)
+       operator := GetOperator()
+    if operator == nil {
+        return nil
+    }
+    report, ok := operator.LogReporter().(LogReporter)
+    if !ok || report == nil {
+        return nil
+    }
+    return report.GetLogContext(withEndpoint)

Review Comment:
   Inconsistent indentation: line 83 uses spaces while line 82 uses tabs. The 
indentation should be consistent throughout the function.



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

Reply via email to