mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13239 from sakateka/zap_raft
etcdserver: add zap.AddCallerSkip in NewRaftLoggerZap
This commit is contained in:
commit
6a32bbad75
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user