Skip to content

Commit 37bc5c3

Browse files
Fix the log that outputs inappropriate file names, function names, and line numbers (#2744)
1 parent 5e774ec commit 37bc5c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logger/zap/zap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func NewDefault() *Logger {
9999
}
100100
encoder := zapcore.NewConsoleEncoder(encoderConfig())
101101
lg = zap.New(zapcore.NewCore(encoder, zapcore.AddSync(os.Stdout), lv),
102-
zap.AddCaller(), zap.AddCallerSkip(1)).Sugar()
102+
zap.AddCaller(), zap.AddCallerSkip(2)).Sugar()
103103
return &Logger{lg: lg}
104104
}
105105

0 commit comments

Comments
 (0)