refactor: use slog.LevelVar for dynamic log levels

Replace the pattern of recreating the logger handler when enabling debug
logging. Now use slog.LevelVar which allows changing the log level
dynamically without recreating the handler or logger instance.

closes #8
This commit is contained in:
clawbot
2026-03-01 15:49:21 -08:00
committed by user
parent d4eef6bd6a
commit 3e3d44a168
2 changed files with 20 additions and 42 deletions

View File

@@ -118,8 +118,6 @@ func New(lc fx.Lifecycle, params ConfigParams) (*Config, error) {
if s.Debug {
params.Logger.EnableDebugLogging()
s.log = params.Logger.Get()
log.Debug("Debug mode enabled")
}
// Log configuration summary (without secrets)