Skip to content

Releases: rust-cli/env_logger

0.8.4

11 Jun 09:15
v0.8.4
Compare
Choose a tag to compare

Improvements:

  • Allow writing logs to a custom output target (via Target::Pipe)

Bug fixes:

  • Actually allow overriding filter levels using env_logger::Builders methods, as documented

0.8.3

11 Feb 18:49
v0.8.3
67adcba
Compare
Choose a tag to compare

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

18 Nov 16:18
v0.8.2
0f53c8d
Compare
Choose a tag to compare

Fixed a panic on io errors when writing to stdout / stderr (#184).

0.8.1

17 Oct 17:25
26e821b
Compare
Choose a tag to compare

Update links in the documentation that were pointing to the old repository location.

0.8.0

16 Oct 18:47
v0.8.0
9ffe00d
Compare
Choose a tag to compare

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 of env_logger::Builder::from_env

This release raises the minimum supported Rust version to 1.41.0.

0.7.1

17 Oct 05:09
68a1700
Compare
Choose a tag to compare

Key Changes

  • More thread-local durability

Contributions

0.7.0

24 Sep 02:04
424f031
Compare
Choose a tag to compare

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

01 Jul 00:08
b598a2c
Compare
Choose a tag to compare

0.6.1

07 Mar 03:55
2ae080e
Compare
Choose a tag to compare

Key Changes

  • Support better capturing for cargo test
  • Don't print internal logs to stdout

Contributions

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

11 Nov 23:57
ebf4829
Compare
Choose a tag to compare

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 compiling env_logger with default-features=false will result in a different experience than in 0.5.x.

Contributions

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.