//! Example of a library utilizing `slog`
#![warn(missing_docs)]/// Re-export slog
////// Users of this library can, but don't have to use slog to build their own
/// loggers
#[macro_use]pubexterncrate slog ;externcrate slog_stdlog;useslog::DrainExt;/// MyLib main struct
pubstructMyLib{logger:slog::Logger,
}implMyLib{/// Initialize `MyLib`, possibly providing custom logger
////// `logger = None`, will make `MyLib` log to the standard `log`
/// crate.
pubfninit(logger:Option<slog::Logger>)->Self{
MyLib {
logger: logger.unwrap_or(slog::Logger::root(slog_stdlog::StdLog.fuse(),o!())),}}/// Do something
pubfndo_the_thing(&self){debug!(self.logger,"starting";"what"=>"the_thing");}}