2022-10-14 08:08:22 +00:00
|
|
|
package dnmshared
|
2022-09-20 15:50:01 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"go.uber.org/zap/zapcore"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Logger *zap.Logger
|
|
|
|
var LoggerConfig zap.Config
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
LoggerConfig = zap.NewDevelopmentConfig()
|
|
|
|
LoggerConfig.Level.SetLevel(zap.InfoLevel)
|
|
|
|
LoggerConfig.Development = false
|
|
|
|
LoggerConfig.Sampling = &zap.SamplingConfig{
|
|
|
|
Initial: 100,
|
|
|
|
Thereafter: 100,
|
|
|
|
}
|
|
|
|
LoggerConfig.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
|
|
|
|
var err error
|
|
|
|
Logger, err = LoggerConfig.Build()
|
2022-10-14 08:08:22 +00:00
|
|
|
if nil != err {
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-09-20 15:50:01 +00:00
|
|
|
}
|