Context
Surfaced during code review of #111 (finding 5, skipped as pre-existing).
Problem
config.parse() emits slog.Warn(...) — the new dashboard deprecation warning, and the pre-existing unknown-tier / DEVCLOUD_SERVICES warnings — before setupLogging() installs the configured slog handler in cmd/devcloud/main.go.
As a result these warnings always go through the default text handler and ignore the operator's logging.format / logging.level. With logging: {format: json}, the warnings come out as plain text and break downstream JSON log parsers.
Why it was deferred
Consistent with the existing warning pattern already in parse() (not introduced by #111). A proper fix means reordering startup so logging is configured before config warnings are produced — and must avoid suppressing the warnings entirely.
Suggested fix
Options:
- Collect warnings during
parse() and flush them after setupLogging(), or
- Return them from
parse()/Load() for the caller to log post-setup, or
- Configure logging early enough that
parse() warnings honor logging.format.
Acceptance
- With
logging.format: json, config-time warnings are emitted as JSON and respect logging.level.
- No config warnings are lost.
Context
Surfaced during code review of #111 (finding 5, skipped as pre-existing).
Problem
config.parse()emitsslog.Warn(...)— the newdashboarddeprecation warning, and the pre-existing unknown-tier /DEVCLOUD_SERVICESwarnings — beforesetupLogging()installs the configured slog handler incmd/devcloud/main.go.As a result these warnings always go through the default text handler and ignore the operator's
logging.format/logging.level. Withlogging: {format: json}, the warnings come out as plain text and break downstream JSON log parsers.Why it was deferred
Consistent with the existing warning pattern already in
parse()(not introduced by #111). A proper fix means reordering startup so logging is configured before config warnings are produced — and must avoid suppressing the warnings entirely.Suggested fix
Options:
parse()and flush them aftersetupLogging(), orparse()/Load()for the caller to log post-setup, orparse()warnings honorlogging.format.Acceptance
logging.format: json, config-time warnings are emitted as JSON and respectlogging.level.