Skip to content

Commit

Permalink
Fix the log that outputs inappropriate file names, function names, an…
Browse files Browse the repository at this point in the history
…d line numbers
  • Loading branch information
marsevilspirit committed Nov 9, 2024
1 parent 5e774ec commit f074663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logger/zap/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func NewDefault() *Logger {
}
encoder := zapcore.NewConsoleEncoder(encoderConfig())
lg = zap.New(zapcore.NewCore(encoder, zapcore.AddSync(os.Stdout), lv),
zap.AddCaller(), zap.AddCallerSkip(1)).Sugar()
zap.AddCaller(), zap.AddCallerSkip(2)).Sugar()
return &Logger{lg: lg}
}

Expand Down

0 comments on commit f074663

Please sign in to comment.