zarthus_env_logger

Crates.iozarthus_env_logger
lib.rszarthus_env_logger
version0.3.0
sourcesrc
created_at2023-08-19 15:26:54.170544
updated_at2024-01-04 17:49:56.560419
descriptionA very opinionated logger
homepage
repositoryhttps://github.com/Zarthus/env_logger
max_upload_size
id948755
size624,598
Jos Ahrens (Zarthus)

documentation

README

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.

Commit count: 13

cargo fmt