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

cargo test not capturing log outputs #150

Closed
liangyongrui opened this issue Dec 30, 2019 · 1 comment
Closed

cargo test not capturing log outputs #150

liangyongrui opened this issue Dec 30, 2019 · 1 comment

Comments

@liangyongrui
Copy link

like #107

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0aa41ea6690fb25c0b60004fa80e8045

I used the example in readme, but still no output.

@KodrAus
Copy link
Collaborator

KodrAus commented Jul 19, 2020

Hey @liangyongrui 👋

Sorry for taking so long to circle around to this! There are two things going on in that sample:

  1. The log events are captured by cargo test, which only shows them for tests that fail, unless you pass the --nocapture flag.
  2. The default environment variable will only show error and above events, so when running cargo test you either need an environment variable like RUST_LOG=info, or add a .filter_level(log::LevelFilter::Info) to your builder.

@KodrAus KodrAus closed this as completed Jul 19, 2020
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

2 participants