Logging: say so when VICTORY_LOG or RUST_LOG does not parse #266

Closed
SkippySteve wants to merge 1 commit from upstream-pr/266 into main
SkippySteve commented 2026-11-24 01:54:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:54:43Z.


A filter that tracing-subscriber rejects, for example VICTORY_LOG=victory_loader=loud, was dropped silently and the binary logged at its default level, so a typo looked like the target had nothing to log.

logging::init now prints one line on stderr naming the variable, its value and the parse error, then falls back to the default level as before:

victory: ignoring VICTORY_LOG="victory_loader=loud" (...); logging at "info"

Picking the filter moves into choose_filter, so it can be tested without changing the process environment. Precedence is unchanged (VICTORY_LOG, then RUST_LOG, then the default).

Tests (Linux):

  • cargo test -p victory-core: 13 passed, including 5 new tests (unset, VICTORY_LOG over RUST_LOG, RUST_LOG fallback, a bad value in each variable)
  • cargo clippy -p victory-core --all-targets -- -D warnings, with and without --features diagnostics: clean
  • cargo fmt --check: clean
<!-- greyfinch-sync:Marvisak/VIctory:issue:6572822964 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/266). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:54:43Z. --- A filter that tracing-subscriber rejects, for example `VICTORY_LOG=victory_loader=loud`, was dropped silently and the binary logged at its default level, so a typo looked like the target had nothing to log. `logging::init` now prints one line on stderr naming the variable, its value and the parse error, then falls back to the default level as before: ``` victory: ignoring VICTORY_LOG="victory_loader=loud" (...); logging at "info" ``` Picking the filter moves into `choose_filter`, so it can be tested without changing the process environment. Precedence is unchanged (VICTORY_LOG, then RUST_LOG, then the default). Tests (Linux): - `cargo test -p victory-core`: 13 passed, including 5 new tests (unset, VICTORY_LOG over RUST_LOG, RUST_LOG fallback, a bad value in each variable) - `cargo clippy -p victory-core --all-targets -- -D warnings`, with and without `--features diagnostics`: clean - `cargo fmt --check`: clean
upstream-sync closed this pull request 2026-11-24 06:52:07 +00:00
SkippySteve commented 2026-11-24 06:55:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T02:34:10Z.


Superseded by #241, which now carries this commit (warn on a bad VICTORY_LOG/RUST_LOG) unchanged.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7120273120 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/266#issuecomment-7120273120). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T02:34:10Z. --- Superseded by #241, which now carries this commit (warn on a bad VICTORY_LOG/RUST_LOG) unchanged.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!266
No description provided.