#log #logger #logging

pretty_env_logger

a visually pretty env_logger

11 releases

0.3.0 Dec 6, 2018
0.2.5 Oct 29, 2018
0.2.4 Jul 11, 2018
0.2.2 Feb 8, 2018
0.1.0 Dec 29, 2016

#8 in Debugging

Download history 2818/week @ 2018-10-11 3269/week @ 2018-10-18 2815/week @ 2018-10-25 4758/week @ 2018-11-01 4206/week @ 2018-11-08 4617/week @ 2018-11-15 3229/week @ 2018-11-22 3753/week @ 2018-11-29 5127/week @ 2018-12-06 6231/week @ 2018-12-13 4598/week @ 2018-12-20 3295/week @ 2018-12-27 2748/week @ 2019-01-03

17,505 downloads per month
Used in 112 crates (96 directly)

MIT/Apache

8KB
99 lines

pretty-env-logger

Crates.io Docs MIT/APACHE-2.0 Travis CI AppVeyor

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.2"

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=myapp=trace cargo run

License

Licensed under either of

Dependencies

~3.5MB
~54K SLoC