Releases: rust-cli/env_logger
0.8.4
0.8.3
New features:
- Suffix customization for the default formatter (
Builder::format_suffix
) [#192]
Improvements:
- Improve documentation about log level names [#189]
Bug fixes:
- Ignore whitespace-only filter specifications [#188]
- Remove unneded files from crates.io tarball (including
rust-toolchain
whose presence caused issues for a few people)
0.8.2
0.8.1
0.8.0
Breaking changes:
- Update public dependency humantime to 2.0
Improvements:
- Update default colors for debug (white => blue) and trace (black => cyan)
Deprecations:
env_logger::from_env
has been deprecated in favor ofenv_logger::Builder::from_env
This release raises the minimum supported Rust version to 1.41.0.
0.7.1
0.7.0
Key Changes
- Indent multiline messages by default
- Support more timestamp precision
- Update to the 2018 edition
Changes to minimum Rust
The minimum version of Rust required has been set at 1.31.0
. We may change this in patch versions, but will always flag it in the release notes here.
You can always check the .travis.yml
file to see the current minimum supported version.
Contributions
0.6.2
Key Changes
- Additional examples and docs
Contributions
0.6.1
Key Changes
- Support better capturing for
cargo test
- Don't print internal logs to
stdout
Contributions
- @nlopes Fix path for rust-lang favicon
- @emilio Don't print to stdout the warnings due to an invalid spec
- Support capturing for cargo test
More Details
Builder::is_test
The is_test
method can be used in tests to make sure logs are captured by cargo test
the same way println!
is:
fn init() {
let _ = env_logger::builder().is_test(true).try_init();
}
#[test]
fn it_adds_one() {
init();
info!("can log from the test too");
assert_eq!(3, add_one(2));
}
There are performance implications of using is_test
though, so it should be avoided outside of unit tests.
0.6.0
Key Changes
- Set a policy for changes to the default format
- Make all dependencies besides
log
optional (but enabled by default)
Breaking Changes
- The default format is not considered stable across patch versions. The best way to get a stable format for later ripgrepping is to define a custom one.
- All dependencies have been made optional except for
log
. That means compilingenv_logger
withdefault-features=false
will result in a different experience than in0.5.x
.
Contributions
- @hcpl Test with
-Z minimal-versions
on CI - @afck Add missing RFC3339 URL to fix rustdoc
- Make all dependencies optional
- Rework the default format
- Don't clobber a previously set level filter
More Details
Disabling dependencies
Using default-features=false
will disable all dependencies of env_logger
besides log
. This will reduce compile times and alter the default format by disabling colours and timestamps.
Disabling default dependencies is the recommended way to use env_logger
for libraries that only need it for logging in tests.