Trait simplelog::SharedLogger [] [src]

pub trait SharedLogger: Log {
    fn level(&self) -> LogLevelFilter;
    fn config(&self) -> Option<&Config>;
    fn as_log(self: Box<Self>) -> Box<Log>;
}

Trait to have a common interface to obtain the LogLevel of Loggers

Necessary for CombinedLogger to calculate the lowest used LogLevel.

Required Methods

Returns the set LogLevel for this Logger

Examples

let logger = SimpleLogger::new(LogLevelFilter::Info, Config::default());
println!("{}", logger.level());

Inspect the config of a running Logger

An Option is returned, because some Logger may not contain a Config

Examples

let logger = SimpleLogger::new(LogLevelFilter::Info, Config::default());
println!("{:?}", logger.config());

Returns the logger as a Log trait object

Implementors