lovely_env_logger

Crates.iolovely_env_logger
lib.rslovely_env_logger
version0.6.1
sourcesrc
created_at2022-05-17 20:32:46.615145
updated_at2024-01-22 22:11:36.222467
descriptiona visually lovely env_logger
homepage
repositoryhttps://github.com/borisfaure/lovely-env-logger
max_upload_size
id588599
size46,779
Boris Faure (borisfaure)

documentation

README

lovely-env-logger

Crates.io Docs MIT/APACHE-2.0

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. Originally a fork from pretty_env_logger.

Screenshots

example default output example output with relative timestamps, short
levels example output with system timestamps, file names and line numbers

Usage

Add the dependency to your Cargo.toml:

[dependencies]
log = "0.4"
lovely_env_logger = "0.6"

Add some usage to your application:

extern crate lovely_env_logger;
#[macro_use] extern crate log;

fn main() {
    lovely_env_logger::init_default();
    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: 93

cargo fmt