seanmonstar/pretty-env-logger

A pretty, easy-to-use logger for Rust.

510

stars

60

commits

Rust

primary language

Feb 13, 2024

updated

crates.io/crates/pretty_env_logger
logging
rust

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

Contributors

seanmonstar

41 commits

nlevitt

3 commits

fawix

2 commits

complexspaces

1 commits

seanmonstar/pretty-env-logger

A pretty, easy-to-use logger for Rust.

510

stars

60

commits

Rust

primary language

Feb 13, 2024

updated

crates.io/crates/pretty_env_logger
logging
rust

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

Contributors

seanmonstar

41 commits

nlevitt

3 commits

fawix

2 commits

complexspaces

1 commits

Languages

Rust

87.1%

Shell

12.9%