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

#63 in Encoding

Download history 67621/week @ 2024-08-02 69601/week @ 2024-08-09 71849/week @ 2024-08-16 72606/week @ 2024-08-23 72949/week @ 2024-08-30 69628/week @ 2024-09-06 67543/week @ 2024-09-13 71312/week @ 2024-09-20 65660/week @ 2024-09-27 62755/week @ 2024-10-04 79608/week @ 2024-10-11 88751/week @ 2024-10-18 80936/week @ 2024-10-25 77744/week @ 2024-11-01 75512/week @ 2024-11-08 76788/week @ 2024-11-15

328,283 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