pretty_env_logger

Crates.iopretty_env_logger
lib.rspretty_env_logger
version0.5.0
sourcesrc
created_at2016-12-29 21:40:51.235536
updated_at2023-05-18 13:53:58.790999
descriptiona visually pretty env_logger
homepage
repositoryhttps://github.com/seanmonstar/pretty-env-logger
max_upload_size
id7848
size30,212
Sean McArthur (seanmonstar)

documentation

README

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

Commit count: 63

cargo fmt