mirror of
https://github.com/genxium/DelayNoMore
synced 2024-12-25 11:18:55 +00:00
26 lines
512 B
Go
26 lines
512 B
Go
package dnmshared
|
|
|
|
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()
|
|
if nil != err {
|
|
panic(err)
|
|
}
|
|
}
|