Skip to content

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