mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-09 12:41:58 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
# Conflicts: # pkg/common/mw/rpc_server_interceptor.go
This commit is contained in:
parent
6de048d84f
commit
3bc6e66b1a
@ -70,6 +70,7 @@ func NewZapLogger() (*ZapLogger, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
zl.zap = l.Sugar()
|
zl.zap = l.Sugar()
|
||||||
|
zl.zap.WithOptions(zap.AddStacktrace(zap.DPanicLevel))
|
||||||
return zl, nil
|
return zl, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +103,14 @@ func (l *ZapLogger) cores() (zap.Option, error) {
|
|||||||
}), nil
|
}), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewErrStackCore(c zapcore.Core) zapcore.Core {
|
||||||
|
return &errStackCore{c}
|
||||||
|
}
|
||||||
|
|
||||||
|
type errStackCore struct {
|
||||||
|
zapcore.Core
|
||||||
|
}
|
||||||
|
|
||||||
func (l *ZapLogger) getWriter() (zapcore.WriteSyncer, error) {
|
func (l *ZapLogger) getWriter() (zapcore.WriteSyncer, error) {
|
||||||
logf, err := rotatelogs.New(config.Config.Log.StorageLocation+sp+"OpenIM.log.all"+".%Y-%m-%d",
|
logf, err := rotatelogs.New(config.Config.Log.StorageLocation+sp+"OpenIM.log.all"+".%Y-%m-%d",
|
||||||
rotatelogs.WithRotationCount(config.Config.Log.RemainRotationCount),
|
rotatelogs.WithRotationCount(config.Config.Log.RemainRotationCount),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user