From a71ac878d8a0c39c157a1a91b7b6fed1b8d6b038 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 05:12:00 +0000 Subject: [PATCH] config: migrate logConfig from legacy log.New to project debug logger Replace the legacy standard-library logger (log.New discarding by default, toggled via SetDebug) with the project's debug logger pattern (logger.New). This makes config package debug output consistent with the rest of the codebase: - Controlled via DEBUG env var (e.g. DEBUG=config:* or DEBUG=*) - Writes to stderr with colors/time-diffs in TTY mode - Also written to the file logger for production troubleshooting Remove the now-unnecessary SetDebug function; callers can use the standard DEBUG env var to enable config debug output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- internal/config/config_core.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/internal/config/config_core.go b/internal/config/config_core.go index e0155801..498e055b 100644 --- a/internal/config/config_core.go +++ b/internal/config/config_core.go @@ -26,13 +26,13 @@ package config import ( "fmt" - "io" - "log" "os" "strings" "time" "github.com/BurntSushi/toml" + + "github.com/github/gh-aw-mcpg/internal/logger" ) // Core constants for configuration defaults @@ -390,14 +390,6 @@ func LoadFromFile(path string) (*Config, error) { return &cfg, nil } -// logger for config package -var logConfig = log.New(io.Discard, "[CONFIG] ", log.LstdFlags) - -// SetDebug enables debug logging for config package -func SetDebug(enabled bool) { - if enabled { - logConfig = log.New(os.Stderr, "[CONFIG] ", log.LstdFlags) - } else { - logConfig = log.New(io.Discard, "[CONFIG] ", log.LstdFlags) - } -} +// logConfig is the debug logger for the config package. +// Enable with DEBUG=config:* or DEBUG=*. +var logConfig = logger.New("config:config")