fix: default to debug if no config is passed, we will then error on config parsing after
This commit is contained in:
parent
39a39b00b7
commit
b6683a5744
|
@ -14,8 +14,12 @@ func NewLogger(cm *config.Manager) (*zap.Logger, *zap.AtomicLevel) {
|
||||||
// Create a new atomic level
|
// Create a new atomic level
|
||||||
atomicLevel := zap.NewAtomicLevel()
|
atomicLevel := zap.NewAtomicLevel()
|
||||||
|
|
||||||
// Set initial log level, for example, info level
|
if cm != nil {
|
||||||
atomicLevel.SetLevel(mapLogLevel(cm.Config().Core.Log.Level))
|
// Set initial log level, for example, info level
|
||||||
|
atomicLevel.SetLevel(mapLogLevel(cm.Config().Core.Log.Level))
|
||||||
|
} else {
|
||||||
|
atomicLevel.SetLevel(mapLogLevel("debug"))
|
||||||
|
}
|
||||||
|
|
||||||
// Create the logger with the atomic level
|
// Create the logger with the atomic level
|
||||||
logger := zap.New(zapcore.NewCore(
|
logger := zap.New(zapcore.NewCore(
|
||||||
|
|
Loading…
Reference in New Issue