Crates.io | pretty_env_logger |
lib.rs | pretty_env_logger |
version | 0.5.0 |
source | src |
created_at | 2016-12-29 21:40:51.235536 |
updated_at | 2023-05-18 13:53:58.790999 |
description | a visually pretty env_logger |
homepage | |
repository | https://github.com/seanmonstar/pretty-env-logger |
max_upload_size | |
id | 7848 |
size | 30,212 |
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.
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
Licensed under either of