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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

obsoleszenz
Copy link

@obsoleszenz obsoleszenz commented May 29, 2024

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 obsoleszenz changed the title Use test_log::test to automatically have env logging in all tests Use test_log::test to have env logging in all tests May 29, 2024
@HEnquist
Copy link
Owner

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.

@obsoleszenz
Copy link
Author

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 rust-lang/cargo#2911

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

Successfully merging this pull request may close these issues.

None yet

2 participants