Skip to content

Commit

Permalink
Merge 39068c1 into 13368cf
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 authored Jan 26, 2022
2 parents 13368cf + 39068c1 commit a4a9238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func InitLogger(conf *Config) {
}

if conf == nil || conf.LumberjackConfig == nil {
zapLogger, _ = config.ZapConfig.Build(zap.AddCallerSkip(1))
zapLogger, _ = config.ZapConfig.Build(zap.AddCaller(), zap.AddCallerSkip(1))
} else {
config.LumberjackConfig = conf.LumberjackConfig
zapLogger = initZapLoggerWithSyncer(config)
Expand Down Expand Up @@ -145,7 +145,7 @@ func initZapLoggerWithSyncer(conf *Config) *zap.Logger {
zap.NewAtomicLevelAt(conf.ZapConfig.Level.Level()),
)

return zap.New(core, zap.AddCallerSkip(1))
return zap.New(core, zap.AddCaller(), zap.AddCallerSkip(1))
}

// getEncoder get encoder by config, zapcore support json and console encoder
Expand Down

0 comments on commit a4a9238

Please sign in to comment.