pub trait SetupLogging {
    // Required methods
    fn set_logging_level(self) -> LevelFilter;
    fn enable_logging(&self);
}
Expand description

Trait to setup logging To initialize logging, call enable_logging on a u8

Required Methods§

Implementations on Foreign Types§

source§

impl SetupLogging for u8

Setup logging. 0 = Info, 1 = Debug, 2 = Trace

source§

fn set_logging_level(self) -> LevelFilter

Set logging level. 0 = Info, 1 = Debug, 2 = Trace to set the logging level, call set_logging_level on a u8

source§

fn enable_logging(&self)

Enable logging

The output is colored and looks like this:
[INFO ][2021-08-22T15:49:01]This is an info message
[DEBUG][2021-08-22T15:49:01]This is a debug message
[TRACE][2021-08-22T15:49:01]This is a trace message
[ERROR][2021-08-22T15:49:01]This is an error message
[WARN ][2021-08-22T15:49:01]This is a warning message
[OTHER][2021-08-22T15:49:01]This is a message with a different log level

The level field is colored and bold if the terminal supports it.

Implementors§