4 releases (2 breaking)

0.6.1 Jan 22, 2024
0.6.0 Feb 8, 2023
0.5.0 May 17, 2022
0.1.0 May 17, 2022

#258 in Debugging

Download history 39/week @ 2024-08-13 39/week @ 2024-08-20 23/week @ 2024-08-27 67/week @ 2024-09-03 44/week @ 2024-09-10 28/week @ 2024-09-17 53/week @ 2024-09-24 45/week @ 2024-10-01 47/week @ 2024-10-08 44/week @ 2024-10-15 35/week @ 2024-10-22 44/week @ 2024-10-29 35/week @ 2024-11-05 23/week @ 2024-11-12 27/week @ 2024-11-19 17/week @ 2024-11-26

117 downloads per month
Used in spotifyctl

MIT/Apache

22KB
382 lines

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

Dependencies

~0.4–7.5MB
~56K SLoC