Skip to content
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

Example given for tracing_subscriber::fmt::format doesn't work #1127

Open
malaire opened this issue Dec 6, 2020 · 1 comment
Open

Example given for tracing_subscriber::fmt::format doesn't work #1127

malaire opened this issue Dec 6, 2020 · 1 comment

Comments

@malaire
Copy link

malaire commented Dec 6, 2020

Bug Report

Version

cargo tree | grep tracing reports

tracing v0.1.22
tracing-attributes v0.1.11
tracing-core v0.1.17
tracing-futures v0.2.4
tracing-log v0.1.1
tracing-serde v0.1.2
tracing-subscriber v0.2.15

Platform

Linux box 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux

Description

When using the example code shows at tracing_subscriber::fmt::format I get no tracing output at all with RUST_LOG=trace cargo run:

let format = tracing_subscriber::fmt::format()
    .without_time()         // Don't include timestamps
    .with_target(false)     // Don't include event targets.
    .with_level(false)      // Don't include event levels.
    .compact();             // Use a more compact, abbreviated format.

// Use the configured formatter when building a new subscriber.
tracing_subscriber::fmt()
    .event_format(format)
    .init();

When I instead use tracing_subscriber::fmt::init() I do get tracing output, so that example is not working.

@malaire
Copy link
Author

malaire commented Dec 10, 2020

It looks like the problem is that the example doesn't set any verbosity level and also doesn't enable EnvFilter.

So maybe either with_env_filter or with_max_level should be added to the example.

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

No branches or pull requests

1 participant