Skip to content

fix(logging): drop the env-filter feature - #41

Merged
jonasz-lasut merged 1 commit into
mainfrom
fix/logging-drop-env-filter
Oct 11, 2026
Merged

jonasz-lasut merged 1 commit into
mainfrom
fix/logging-drop-env-filter

Conversation

@jonasz-lasut

Copy link
Copy Markdown
Collaborator

#38 enabled tracing-subscriber's env-filter feature, which Cargo turns on in every function that depends on the SDK, so a function that calls tracing_subscriber::fmt::init() itself logs only errors when RUST_LOG is unset. This filters with Targets instead, which needs no extra feature: RUST_LOG keeps working for target=level directives, and a value with span or field filters is ignored with a warning.

#38 enabled tracing-subscriber's env-filter feature, and Cargo unifies
features across a build, so it was on in every function that depends
on the SDK. That changes tracing_subscriber::fmt::init(): with RUST_LOG
unset it installs an EnvFilter that defaults to ERROR instead of INFO,
so a function that sets up logging itself lost its info and warn logs.

Filter with Targets instead, which needs no extra feature. RUST_LOG
still replaces the level selection for target=level directives and
bare levels; a RUST_LOG with span or field filters is ignored with a
warning, and the --debug selection applies.

Signed-off-by: Jonasz Małecki <jonasz@upbound.io>
@jonasz-lasut
jonasz-lasut marked this pull request as ready for review October 11, 2026 15:58
@jonasz-lasut
jonasz-lasut merged commit 06136be into main Oct 11, 2026
5 checks passed
@jonasz-lasut
jonasz-lasut deleted the fix/logging-drop-env-filter branch October 11, 2026 15:58
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