1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
use std::sync::Mutex;
use slog::{Logger, Drain};

lazy_static! {
    static ref LOGGER: Logger = {
         let decorator = slog_term::TermDecorator::new().build();
        let drain = Mutex::new(slog_term::FullFormat::new(decorator).build()).fuse();
        Logger::root(drain, o!("version" => env!("CARGO_PKG_VERSION")))
    };
}
pub fn logger() -> &'static Logger {
    &LOGGER
}