Skip to content

Commit

Permalink
Merge pull request vmware-tanzu#609 from zhengxiexie/zhengxie/log_caller
Browse files Browse the repository at this point in the history
Add back caller to log
  • Loading branch information
zhengxiexie authored Jun 21, 2024
2 parents b7bf875 + 447a35c commit 566bc19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func ZapLogger(cfDebug bool, cfLogLevel int) logr.Logger {
zapcore.AddSync(zapcore.Lock(os.Stdout)),
zapcore.Level(-1*logLevel),
)
zapLogger := zap.New(core)
zapLogger := zap.New(core, zap.AddCaller(), zap.AddCallerSkip(1))

defer zapLogger.Sync()

return zapr.NewLogger(zapLogger)
Expand Down

0 comments on commit 566bc19

Please sign in to comment.