slogging: add a default if unknown level is set
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0efb419d56
commit
e44238600b
@ -57,6 +57,11 @@ func SetLevel(level int) *Logger {
|
|||||||
|
|
||||||
case LevelError:
|
case LevelError:
|
||||||
opts.Level = slog.LevelError
|
opts.Level = slog.LevelError
|
||||||
|
|
||||||
|
default:
|
||||||
|
logger.Infof("unknown level '%d', resetting to level INFO", level)
|
||||||
|
|
||||||
|
opts.Level = slog.LevelInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := logger.Handler().(*slog.JSONHandler); ok {
|
if _, ok := logger.Handler().(*slog.JSONHandler); ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user