Per GO_HTTP_SERVER_CONVENTIONS §9 (Logger Setup with TTY Detection), the logger should use slog.LevelVar to allow dynamic log level changes without recreating the handler:
Currently, internal/logger/logger.goEnableDebugLogging() recreates the entire slog.Handler and slog.Logger just to change the level. This means any component that cached the *slog.Logger from Get() before EnableDebugLogging() was called will still use the old info-level logger.
Using slog.LevelVar allows changing the level atomically without replacing the handler, and all existing references to the logger automatically respect the new level.
Per GO_HTTP_SERVER_CONVENTIONS §9 (Logger Setup with TTY Detection), the logger should use `slog.LevelVar` to allow dynamic log level changes without recreating the handler:
```go
l.level = new(slog.LevelVar)
l.level.Set(slog.LevelInfo)
// ...
opts := &slog.HandlerOptions{Level: l.level}
```
Currently, `internal/logger/logger.go` `EnableDebugLogging()` recreates the entire `slog.Handler` and `slog.Logger` just to change the level. This means any component that cached the `*slog.Logger` from `Get()` before `EnableDebugLogging()` was called will still use the old info-level logger.
Using `slog.LevelVar` allows changing the level atomically without replacing the handler, and all existing references to the logger automatically respect the new level.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Per GO_HTTP_SERVER_CONVENTIONS §9 (Logger Setup with TTY Detection), the logger should use
slog.LevelVarto allow dynamic log level changes without recreating the handler:Currently,
internal/logger/logger.goEnableDebugLogging()recreates the entireslog.Handlerandslog.Loggerjust to change the level. This means any component that cached the*slog.LoggerfromGet()beforeEnableDebugLogging()was called will still use the old info-level logger.Using
slog.LevelVarallows changing the level atomically without replacing the handler, and all existing references to the logger automatically respect the new level.clawbot referenced this issue2026-03-02 00:56:20 +01:00