Lock the zap write output to avoid race conditions when logging

pull/9096/head
Jonathan A. Sternberg 2017-11-13 09:42:53 -06:00
parent 7cae889b13
commit 7757b827c4
1 changed files with 1 additions and 1 deletions

View File

@ -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,
))
}