[][src]Trait simplelog::SharedLogger

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

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

Necessary for CombinedLogger to calculate the lowest used Level.

Required methods

fn level(&self) -> LevelFilter

Returns the set Level for this Logger

Examples

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

fn config(&self) -> Option<&Config>

Inspect the config of a running Logger

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

Examples

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

fn as_log(self: Box<Self>) -> Box<dyn Log>

Returns the logger as a Log trait object

Loading content...

Implementors

impl SharedLogger for CombinedLogger[src]

impl SharedLogger for SimpleLogger[src]

impl SharedLogger for TermLogger[src]

impl<W: Write + Send + 'static> SharedLogger for WriteLogger<W>[src]

Loading content...