Skip to content

config: warnings in parse() emit before logging is configured (ignores logging.format/level) #113

Closed

Description

@skyoo2003

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

choreMaintenance task

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions