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

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

obsoleszenz
Copy link
Contributor

@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
Contributor 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

@HEnquist HEnquist merged commit 69a1cb1 into HEnquist:master Sep 28, 2024
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.

2 participants