#env-logger #logging #zarthus

zarthus_env_logger

A very opinionated logger

3 releases (breaking)

0.3.0 Jan 4, 2024
0.2.0 Aug 27, 2023
0.1.0 Aug 19, 2023

#323 in Debugging

Download history 301/week @ 2024-01-02 9/week @ 2024-01-16 85/week @ 2024-01-30 5/week @ 2024-02-13 13/week @ 2024-02-20 145/week @ 2024-02-27 14/week @ 2024-03-05 14/week @ 2024-03-12 33/week @ 2024-03-26 104/week @ 2024-04-02

156 downloads per month

MIT/Apache

585KB
132 lines

zarthus_env_logger

version

The most opinionated logger you'll find.

Does nothing if RUST_LOG is set.

Usage

cargo add log
cargo add zarthus_env_logger
#[macro_use]
extern crate log;

fn main() {
    zarthus_env_logger::init();

    info!("Hello, world!");    
}

What does it do differently?

  • Absolutely nothing if RUST_LOG is set.
  • The name of the package is shortened (to @)
  • Log filters to debug by default for your own package, and error for all other packages.
  • Timestamps are handled with chrono or time (if possible), and included by default
  • Opinionated colouring

image/ascii.gif

License

Licensed under the following licenses at your option:

Files in the project may not be copied, modified, or distributed except according to those terms.

Dependencies

~4–5.5MB
~92K SLoC