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

#23 in Debugging

Download history 193438/week @ 2024-08-13 199681/week @ 2024-08-20 174548/week @ 2024-08-27 203632/week @ 2024-09-03 214956/week @ 2024-09-10 211367/week @ 2024-09-17 230243/week @ 2024-09-24 226921/week @ 2024-10-01 248317/week @ 2024-10-08 239391/week @ 2024-10-15 262366/week @ 2024-10-22 232264/week @ 2024-10-29 253367/week @ 2024-11-05 232425/week @ 2024-11-12 221329/week @ 2024-11-19 119889/week @ 2024-11-26

870,666 downloads per month
Used in 1,244 crates (1,119 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

~2.8–4MB
~70K SLoC