5 unstable releases

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

#227 in Debugging

Download history 25/week @ 2024-11-23 22/week @ 2024-11-30 48/week @ 2024-12-07 74/week @ 2024-12-14 30/week @ 2024-12-21 11/week @ 2024-12-28 21/week @ 2025-01-04 45/week @ 2025-01-11 35/week @ 2025-01-18 33/week @ 2025-01-25 36/week @ 2025-02-01 68/week @ 2025-02-08 72/week @ 2025-02-15 165/week @ 2025-02-22 168/week @ 2025-03-01 63/week @ 2025-03-08

489 downloads per month
Used in spotifyctl

MIT/Apache

22KB
387 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–8.5MB
~66K SLoC