diff --git a/logger/logger.go b/logger/logger.go index 5ecfd1f..22828c4 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -25,6 +25,15 @@ var defaultLogger slog.Logger // nolint: gochecknoglobals type Field = slog.Field type Map = slog.Map +type Level = slog.Level + +const ( + LevelCritical Level = slog.LevelCritical + LevelError Level = slog.LevelError + LevelWarn Level = slog.LevelWarn + LevelInfo Level = slog.LevelInfo + LevelDebug Level = slog.LevelDebug +) func init() { // nolint: gochecknoinits defaultLogger = Make(FormatHuman, os.Stdout) @@ -87,6 +96,6 @@ func E(err error) Field { return slog.Error(err) } -func SetLevel(level slog.Level) { +func SetLevel(level Level) { defaultLogger = defaultLogger.Leveled(level) }