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

Support capturing for cargo test #127

Merged
merged 2 commits into from
Mar 3, 2019
Merged

Conversation

KodrAus
Copy link
Collaborator

@KodrAus KodrAus commented Feb 26, 2019

Closes #107

Adds an is_test method to the Builder that can be used to force the logger to output using the print or eprint macros instead of through termcolor directly. Using a builder method instead of features guarantees no matter what your env_logger configuration, you'll be able to make cargo test capture logs. is_test is slower than using termcolor.

I've also introduced some convenient crate functions to get a Builder:

  • env_logger::builder() is like env_logger::Builder::from_default_env()
  • env_logger::from_env(e) is like env_logger::Builder::from_env(e)

@KodrAus KodrAus merged commit 8fa6240 into rust-cli:master Mar 3, 2019
@KodrAus KodrAus deleted the feat/is_test branch March 3, 2019 23:52
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.

1 participant