2 stable releases

1.0.1 Mar 17, 2024

#531 in Debugging

MIT/Apache

7KB

crates.io Documentation

Microlog

Dead simple log subscriber, coming in at only 38 meaningful lines of code.

Example

microlog::init(microlog::LevelFilter::Trace);

log::trace!("Trace test");
log::debug!("Debug test");
log::info!("Info test");
log::warn!("Info test");
log::error!("Info test");

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Microlog

Dead simple log subscriber, coming in at only 38 meaningful lines of code.

  • Just prints the Level (in color) and the message, nothing more nothing less.

  • All functions respect the RUST_LOG env variable to override the log level at runtime.

  • All functions support the NO_COLOR and CLICOLOR env variables to disable/change colored output at runtime. See the colored crate for details.

Features

  • no-color: This feature allows you to completely compile out coloring code.

Example

microlog::init(microlog::LevelFilter::Trace);

log::trace!("Trace test");
log::debug!("Debug test");
log::info!("Info test");
log::warn!("Info test");
log::error!("Info test");

Dependencies

~0.1–6MB
~35K SLoC