Crate bunt_logger

Crate bunt_logger 

Source
Expand description

A simple logger wrapper around bunt.

§Usage

use bunt_logger::{
    debug, error, info, trace, warn,
    ColorChoice,
    Level, // re-export of `log::Level`
};

fn main() {
    bunt_logger::with()
        .level(Level::Trace)
        .stderr(ColorChoice::Always);

    error!("{$red+bold}A red and bold error message!{/$}");
    warn!("{$yellow}A yellow warning message!{/$}");
    info!("{$green}A green info message!{/$}");
    debug!("{$cyan}A cyan debug message!{/$}");
    trace!("{$white+dimmed}A white and dimmed trace message!{/$}");
}

Macros§

debug
Like log::debug, but bunt-compatible.
error
Like log::error, but bunt-compatible.
info
Like log::info, but bunt-compatible.
trace
Like log::trace, but bunt-compatible.
warn
Like log::warn, but bunt-compatible.

Structs§

LogPrefs
Preferences that dictate logging.
StandardStream
Satisfies io::Write and WriteColor, and supports optional coloring to either of the standard output streams, stdout and stderr.

Enums§

ColorChoice
ColorChoice represents the color preferences of an end user.
Level
An enum representing the available verbosity levels of the logger.

Traits§

WriteColor
This trait describes the behavior of writers that support colored output.

Functions§

with
Returns a reference to the global preferences object, used for modifying preferences.