Skip to content

fix: return configuration warnings instead of logging them - #341

Merged
cplieger merged 1 commit into
mainfrom
fix/config-returns-warnings
Sep 12, 2026
Merged

fix: return configuration warnings instead of logging them#341
cplieger merged 1 commit into
mainfrom
fix/config-returns-warnings

Conversation

@cplieger

Copy link
Copy Markdown
Owner

Summary

config.Load and config.ScanInterval logged their three non-fatal parse warnings (unknown LOG_LEVEL, invalid SCAN_INTERVAL, clamped LOOKBACK_HOURS) straight to the process logger. The health subcommand runs every 30s and derives its deadline through ScanInterval, so a misconfigured interval produced one warning line per probe. Both functions now return []Warning values and the package never logs. The daemon emits them once, before the parsed LOG_LEVEL is applied so an error level cannot hide the warning that explains it; the probe discards them.

The urlsafe package doc records that registry-stats carries a diverged copy nothing synchronizes.

Tested

Config tests assert on the returned warnings instead of a captured logger; a new TestLoadNeverLogs pins the no-logging contract and was red-checked with a planted slog.Warn. go test -count=1 -race ./..., golangci-lint run (0 issues) and deadcode -test ./... clean.

…onfig package

`config.Load` and `config.ScanInterval` logged their three non-fatal parse
warnings (an unknown LOG_LEVEL, an invalid SCAN_INTERVAL, a clamped
LOOKBACK_HOURS) through the process logger. That put a warning in the output
of the `health` subcommand, which runs every 30s and derives its deadline
through `ScanInterval`, so a misconfigured interval produced a warning line
per probe. Both now return `[]Warning` values; the daemon emits them once,
before the parsed LOG_LEVEL is applied, so an `error` level cannot hide the
warning that explains it, and the probe discards them. The urlsafe package doc
records that registry-stats carries a diverged copy nothing synchronizes.
@cplieger
cplieger merged commit d2a5251 into main Sep 12, 2026
19 checks passed
@cplieger
cplieger deleted the fix/config-returns-warnings branch September 12, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant