mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
zap
This commit is contained in:
parent
ede2097678
commit
1039d44284
@ -102,12 +102,12 @@ func (l *ZapLogger) cores(logLevel int, isStdout bool, isJson bool, logLocation
|
||||
fileEncoder = zapcore.NewJSONEncoder(c)
|
||||
} else {
|
||||
c.EncodeLevel = zapcore.CapitalColorLevelEncoder
|
||||
fileEncoder = zapcore.NewConsoleEncoder(c)
|
||||
customCallerEncoder := func(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) {
|
||||
// enc.AppendString("[" + l.traceId + "]")
|
||||
enc.AppendString("[" + caller.TrimmedPath() + "]")
|
||||
}
|
||||
c.EncodeCaller = customCallerEncoder
|
||||
fileEncoder = zapcore.NewConsoleEncoder(c)
|
||||
}
|
||||
fileEncoder.AddInt("PID", os.Getpid())
|
||||
writer, err := l.getWriter(logLocation, rotateCount)
|
||||
|
Loading…
x
Reference in New Issue
Block a user