Lock the zap write output to avoid race conditions when logging
parent
7cae889b13
commit
7757b827c4
|
@ -15,7 +15,7 @@ func New(w io.Writer) *zap.Logger {
|
|||
}
|
||||
return zap.New(zapcore.NewCore(
|
||||
zapcore.NewConsoleEncoder(config),
|
||||
zapcore.AddSync(w),
|
||||
zapcore.Lock(zapcore.AddSync(w)),
|
||||
zapcore.DebugLevel,
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue