rubato icon indicating copy to clipboard operation
rubato copied to clipboard

Use test_log::test to have env logging in all tests

Open obsoleszenz opened this issue 1 year ago • 2 comments

To enable logging in tests one can now simply use the RUST_LOG=trace environment variable.

Example:

RUST_LOG=trace cargo test --features log

Also added the log feature to Cargo.toml, i think it's cleaner to list all features explicitly.

obsoleszenz avatar May 29 '24 18:05 obsoleszenz

This looks pretty neat. Would it be possible to have the logging enabled automatically when running the tests? Enabling the log feature works of course, but it would nicer to not need to do that.

HEnquist avatar May 29 '24 20:05 HEnquist

This looks pretty neat. Would it be possible to have the logging enabled automatically when running the tests? Enabling the log feature works of course, but it would nicer to not need to do that.

Sadly cargo doesn't support this yet https://github.com/rust-lang/cargo/issues/2911

obsoleszenz avatar May 29 '24 21:05 obsoleszenz