slog-stdlog 0.7.0

Standard Rust log crate adapter to slog-rs

Standard Rust log crate adapter to slog-rs

This crate allows setting one of slog Loggers as a global handler of Rust de facto standard logging statements (eg info!(...)) provided by log create.

#[macro_use]
extern crate slog;
#[macro_use]
extern crate log;
extern crate slog_stdlog;

use slog::*;

fn main() {
    let root = Logger::new_root(
        o!("build-id" => "8dfljdf"),
        slog::drain::discard(),
    );
    slog_stdlog::set_logger(root).unwrap();
    info!("standard logging redirected to slog");
}