Logger should use slog.LevelVar for dynamic level switching #8
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/webhooker#8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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