both stdout and file

test-errcode
wangchuxiao 1 year ago
parent 03d910028b
commit 2a78974cc1

@ -119,7 +119,7 @@ func (l *ZapLogger) cores(isStdout bool, isJson bool, logLocation string, rotate
return nil, err return nil, err
} }
var cores []zapcore.Core var cores []zapcore.Core
if logLocation != "" && !isStdout { if logLocation != "" {
cores = []zapcore.Core{ cores = []zapcore.Core{
zapcore.NewCore(fileEncoder, writer, zap.NewAtomicLevelAt(l.level)), zapcore.NewCore(fileEncoder, writer, zap.NewAtomicLevelAt(l.level)),
} }

Loading…
Cancel
Save