My experience (I haven't put together a minimum reproducible sample yet): Tests annotated with
#[traced_test]
#[tokio::test]
and run with --nocapture
will display (on stdout) output from info!
and other tracing macros from within the test file, but not from other files (functions called from the test).
Replacing info!
with println!
results in the output being shown.
It sounds like you are talking about the default behavior of tracing-test
filtering external crates. Other modules within the same crate should not be affected. I cannot reproduce your findings.
If you do want to enable #[traced_test]
to capture logs from external crates, enable the no-env-filter
feature flag. (And do not use tracing-test
version 0.1 as shown in the TOML snippet. The current version is 0.2.)
1 Like