AlexStocks commented on code in PR #3195:
URL: https://github.com/apache/dubbo-go/pull/3195#discussion_r2899093762


##########
logger/base.go:
##########
@@ -41,3 +45,16 @@ type Logger interface {
        Fatal(args ...any)
        Fatalf(fmt string, args ...any)
 }
+
+// CtxLogger extends Logger interface with context-aware logging methods.
+type CtxLogger interface {
+       Logger
+       CtxDebug(ctx context.Context, args ...any)
+       CtxDebugf(ctx context.Context, template string, args ...any)
+       CtxInfo(ctx context.Context, args ...any)
+       CtxInfof(ctx context.Context, template string, args ...any)
+       CtxWarn(ctx context.Context, args ...any)
+       CtxWarnf(ctx context.Context, template string, args ...any)
+       CtxError(ctx context.Context, args ...any)
+       CtxErrorf(ctx context.Context, template string, args ...any)
+}

Review Comment:
   `Logger` 基接口包含 `Fatal`/`Fatalf`,但 `CtxLogger` 没有对应的 
`CtxFatal`/`CtxFatalf`,接口层面不对称。
   
   建议:补充这两个方法;或者在注释里明确说明 fatal 场景故意排除在外(如进程退出,span 无法完整提交)。



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