14 releases

Uses old Rust 2015

0.5.0 May 18, 2023
0.4.0 Jan 29, 2020
0.3.1 Aug 16, 2019
0.3.0 Dec 6, 2018
0.1.0 Dec 29, 2016

#26 in Debugging

Download history 177303/week @ 2024-06-14 187515/week @ 2024-06-21 174071/week @ 2024-06-28 171123/week @ 2024-07-05 170446/week @ 2024-07-12 177316/week @ 2024-07-19 170666/week @ 2024-07-26 157928/week @ 2024-08-02 193515/week @ 2024-08-09 203432/week @ 2024-08-16 189731/week @ 2024-08-23 178338/week @ 2024-08-30 214317/week @ 2024-09-06 198237/week @ 2024-09-13 247995/week @ 2024-09-20 169910/week @ 2024-09-27

869,061 downloads per month
Used in 1,221 crates (1,094 directly)

MIT/Apache

11KB
106 lines

pretty-env-logger

Crates.io Docs MIT/APACHE-2.0 Travis CI

A simple logger built on top of 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.4"

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

~3–4.5MB
~71K SLoC