12 releases

0.3.1 Aug 16, 2019
0.3.0 Dec 6, 2018
0.2.5 Oct 29, 2018
0.2.4 Jul 11, 2018
0.1.0 Dec 29, 2016

#22 in Debugging

Download history 27962/week @ 2019-10-15 25775/week @ 2019-10-22 22632/week @ 2019-10-29 26345/week @ 2019-11-05 23424/week @ 2019-11-12 25172/week @ 2019-11-19 21135/week @ 2019-11-26 24543/week @ 2019-12-03 25678/week @ 2019-12-10 21090/week @ 2019-12-17 11774/week @ 2019-12-24 15372/week @ 2019-12-31 28165/week @ 2020-01-07 22927/week @ 2020-01-14 22557/week @ 2020-01-21

107,373 downloads per month
Used in 263 crates (206 directly)

MIT/Apache

10KB
100 lines

pretty-env-logger

Crates.io Docs MIT/APACHE-2.0 Travis CI

A simple logger built on top off env_logger. It is configured via an environment variable and writes to standard error with nice colored output for log levels.

example output

Usage

Add the dependency to your Cargo.toml:

[dependencies]
log = "0.4"
pretty_env_logger = "0.3"

Add some usage to your application:

extern crate pretty_env_logger;
#[macro_use] extern crate log;

fn main() {
    pretty_env_logger::init();
    info!("such information");
    warn!("o_O");
    error!("much error");
}

Then run your app with the environmental variable set:

RUST_LOG=trace cargo run

License

Licensed under either of

Dependencies

~2.5MB
~58K SLoC