You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During initialization in the tint.NewHandler, the minimum logging level is copied as a number and then used as an absolute value that cannot be changed.
And in the settings, not just the minimum level is set, but the slog.Leveler interface, which allows you to safely change this value in the future.
varprogramLevel=new(slog.LevelVar) // Info by defaulth:=tint.NewHandler(os.Stderr, &tint.HandlerOptions{
Level: programLevel,
})
slog.SetDefault(slog.New(h))
// ...programLevel.Set(slog.LevelDebug) // <- DON'T WORK!!!
During initialization in the
tint.NewHandler
, the minimum logging level is copied as a number and then used as an absolute value that cannot be changed.And in the settings, not just the minimum level is set, but the
slog.Leveler
interface, which allows you to safely change this value in the future.FYI: https://pkg.go.dev/golang.org/x/exp/slog#hdr-Levels
Accordingly, in the internal
handler
you also need to replacelevel slog.Level
withslog.Leveler
and:The text was updated successfully, but these errors were encountered: