Crate microlog

Source
Expand description

§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");

Enums§

LevelFilter
An enum representing the available verbosity level filters of the logger.

Functions§

init
Sets the global logger to microlog. This function should be called very early in the program and must only be called once.
try_init
Attempts to set the global logger to microlog. This function should be called very early in the program.