Merge pull request #13239 from sakateka/zap_raft

etcdserver: add zap.AddCallerSkip in NewRaftLoggerZap
This commit is contained in:
Sahdev Zala 2021-08-21 14:11:05 -04:00 committed by GitHub
commit 6a32bbad75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,8 @@ func NewRaftLogger(lcfg *zap.Config) (raft.Logger, error) {
// NewRaftLoggerZap converts "*zap.Logger" to "raft.Logger".
func NewRaftLoggerZap(lg *zap.Logger) raft.Logger {
return &zapRaftLogger{lg: lg, sugar: lg.Sugar()}
skipCallerLg := lg.WithOptions(zap.AddCallerSkip(1))
return &zapRaftLogger{lg: skipCallerLg, sugar: skipCallerLg.Sugar()}
}
// NewRaftLoggerFromZapCore creates "raft.Logger" from "zap.Core"