pkg/logutil/zap_raft.go
func NewRaftLogger(lcfg *zap.Config) (raft.Logger, error) {
	if lcfg == nil {
		return nil, errors.New("nil zap.Config")
	}
	lg, err := lcfg.Build(zap.AddCallerSkip(1)) // to annotate caller outside of "logutil"
	if err != nil {
		return nil, err
	}
	return &zapRaftLogger{lg: lg, sugar: lg.Sugar()}, nil
}
func NewRaftLogger(lcfg *zap.Config) (raft.Logger, error) {
	if lcfg == nil {
		return nil, errors.New("nil zap.Config")
	}
	lg, err := lcfg.Build(zap.AddCallerSkip(1)) // to annotate caller outside of "logutil"
	if err != nil {
		return nil, err
	}
	return &zapRaftLogger{lg: lg, sugar: lg.Sugar()}, nil
}
func NewRaftLogger ( lcfg * zap . Config ) ( raft . Logger , error ) { if lcfg == nil { return nil , errors . New ( " " ) } lg , err := lcfg . Build ( zap . AddCallerSkip ( 1 ) ) // to annotate caller outside of "logutil" if err != nil { return nil , err } return & zapRaftLogger { lg : lg , sugar : lg . Sugar ( ) } , nil }
// NewRaftLogger converts "*zap.Logger" to "raft.Logger".
NewRaftLogger converts * zap . Logger to raft . Logger .