mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
zap
This commit is contained in:
parent
656206c95a
commit
2c08e1c361
@ -83,9 +83,9 @@ func (l *ZapLogger) timeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
|
|||||||
|
|
||||||
func (l *ZapLogger) cores() (zap.Option, error) {
|
func (l *ZapLogger) cores() (zap.Option, error) {
|
||||||
c := zap.NewProductionEncoderConfig()
|
c := zap.NewProductionEncoderConfig()
|
||||||
c.EncodeTime = l.timeEncoder
|
c.EncodeTime = zapcore.ISO8601TimeEncoder
|
||||||
c.EncodeDuration = zapcore.SecondsDurationEncoder
|
c.EncodeDuration = zapcore.SecondsDurationEncoder
|
||||||
//c.EncodeLevel = zapcore.CapitalColorLevelEncoder
|
//c.EncodeLevel = zapcore.LowercaseColorLevelEncoder
|
||||||
fileEncoder := zapcore.NewJSONEncoder(c)
|
fileEncoder := zapcore.NewJSONEncoder(c)
|
||||||
fileEncoder.AddInt("PID", os.Getpid())
|
fileEncoder.AddInt("PID", os.Getpid())
|
||||||
writer, err := l.getWriter()
|
writer, err := l.getWriter()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user