-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tracing-subscriber 0.3.1 does not respect RUST_LOG #1697
Comments
I’ll update the changelog later, but the (The documentation for EnvFilter alludes to this, but this should be in a more prominent spot: https://docs.rs/tracing-subscriber/0.3.1/tracing_subscriber/struct.EnvFilter.html) |
The changelog does mention the feature flagging change: https://github.com/tokio-rs/tracing/blob/v0.1.x/tracing-subscriber/CHANGELOG.md#breaking-changes but it may not be obvious what behavior this changes, so we might want to clarify that changelog entry. I think the most important docs improvement, though, might be to change the documentation for methods like |
Actually, now that I think about it, we could probably change |
perhaps we could log a warning if |
Despite enabling the I have to manually add the filter:
Is it corect that this is not the expected behaviour? |
…is not enabled Close tokio-rs#1697
…t enabled(#1781) The removal of `env-filter` from the default features in 0.3.0 has caused a lot of developer frustration. This PR changes `tracing_subscriber::fmt::init()` and `try_init` to fall back to adding a `Targets` filter parsed from the `RUST_LOG` environment variable, rather than a `LevelFilter` with the default max level. This way, `RUST_LOG`-based filtering will still "just work" out of the box with the default initialization functions, regardless of whether or not `EnvFilter` is enabled. Closes #1697 Co-authored-by: Eliza Weisman <eliza@buoyant.io>
I can reproduce this as well:
Using RUST_LOG=trace or debug both will not show the above messages.
|
@Firstyear that's because
It is confusing, #1329 tl;dr
|
Yes, I think the docs also suggested at one point |
Gonna close this since this was fixed in tracing-subscriber 0.3.5 with #1781. |
…tokio-rs#1700) Resolves tokio-rs#1697 by documenting this change in the CHANGELOG.md.
…t enabled(tokio-rs#1781) The removal of `env-filter` from the default features in 0.3.0 has caused a lot of developer frustration. This PR changes `tracing_subscriber::fmt::init()` and `try_init` to fall back to adding a `Targets` filter parsed from the `RUST_LOG` environment variable, rather than a `LevelFilter` with the default max level. This way, `RUST_LOG`-based filtering will still "just work" out of the box with the default initialization functions, regardless of whether or not `EnvFilter` is enabled. Closes tokio-rs#1697 Co-authored-by: Eliza Weisman <eliza@buoyant.io>
Bug Report
Version
tracing-subscriber 0.3.1
Platform
Linux
Description
tracing-subscriber seems to incorrectly handle the RUST_LOG env var.
After
tracing_subscriber::fmt::init()
I only getINFO
and above events, regardless of theRUST_LOG
env var (RUST_LOG=trace, RUST_LOG=crate=trace, ...)Downgrading to
0.2
fixes this.(I checked the release notes for changed behaviour, but it seems like there aren't any relevant alterations)
The text was updated successfully, but these errors were encountered: