26 releases (13 stable)

2.6.1 Mar 21, 2022
2.5.0 Jan 22, 2022
2.4.0 Jul 29, 2021
2.3.0 Dec 4, 2018
0.6.0 Jul 19, 2016

#65 in Encoding

Download history 74178/week @ 2024-09-03 69881/week @ 2024-09-10 66119/week @ 2024-09-17 69538/week @ 2024-09-24 63241/week @ 2024-10-01 68437/week @ 2024-10-08 85893/week @ 2024-10-15 87068/week @ 2024-10-22 79313/week @ 2024-10-29 75649/week @ 2024-11-05 75099/week @ 2024-11-12 76668/week @ 2024-11-19 69729/week @ 2024-11-26 81846/week @ 2024-12-03 84890/week @ 2024-12-10 66336/week @ 2024-12-17

315,823 downloads per month
Used in 73 crates (43 directly)

MPL-2.0 OR MIT OR Apache-2.0

18KB
258 lines

slog-rs logo
Travis CI Build Status slog-json on crates.io slog-rs Gitter Chat

slog-json - JSON drain for slog-rs

For more information, help, to report issues etc. see slog-rs.

Note

slog_json parses the logged Record values only, consider using slog-bunyan instead for a more complete output format.


lib.rs:

JSON Drain for slog-rs

#[macro_use]
extern crate slog;

use slog::Drain;
use std::sync::Mutex;

fn main() {
    let root = slog::Logger::root(
        Mutex::new(slog_json::Json::default(std::io::stderr())).map(slog::Fuse),
        o!("version" => env!("CARGO_PKG_VERSION"))
    );
}

Dependencies

~1.3–2MB
~38K SLoC