Open urkle opened 6 months ago
The print is needed if you want the log output to show up in the terminal for failed tests.
Why would you want it suppressed?
Because it makes my test output very noisy for when tests pass since it'll display for ALL tests not just tests that are checking log output.
Couldn't we modify the logs_contain or logs_assert methods to spit out data for failed tests only? (would you be open to a PR for this?)
What test runner are you using, cargo test
? That should usually capture all test output, and only show it for failing tests.
It is cargo test, but run via RustRover (Jetbrains IDE) which turns on output all the time so it can capture things :)
I'll recheck things tomorrow when I work on that project that would be using this.
We could add a Cargo build flag to suppress log output. I don't want to remove the print in the crate's default behavior though, it is very useful to debug failed tests.
@urkle is this still an issue for you? If yes, a PR with a cargo feature no-log-printing
would be welcome.
https://github.com/dbrgn/tracing-test/blob/9b8aa601f00fd60c1eaf0a1642713e983282ab6a/tracing-test/src/subscriber.rs#L36-L37
Is this print really needed? for this crate to work? Can't we have thus suppressed?