#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

#11 in Debugging

Download history 3393/week @ 2018-12-20 3204/week @ 2018-12-27 4614/week @ 2019-01-03 4801/week @ 2019-01-10 4851/week @ 2019-01-17 5266/week @ 2019-01-24 5578/week @ 2019-01-31 6452/week @ 2019-02-07 6753/week @ 2019-02-14 6673/week @ 2019-02-21 8432/week @ 2019-02-28 8773/week @ 2019-03-07 9259/week @ 2019-03-14 8265/week @ 2019-03-21 8910/week @ 2019-03-28

17,505 downloads per month
Used in 134 crates (121 directly)

MIT/Apache

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

License

Licensed under either of

Dependencies

~3.5MB
~51K SLoC