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 63962/week @ 2024-10-05 82431/week @ 2024-10-12 89037/week @ 2024-10-19 79876/week @ 2024-10-26 77520/week @ 2024-11-02 74434/week @ 2024-11-09 76683/week @ 2024-11-16 69709/week @ 2024-11-23 79909/week @ 2024-11-30 85789/week @ 2024-12-07 80933/week @ 2024-12-14 23026/week @ 2024-12-21 28366/week @ 2024-12-28 80050/week @ 2025-01-04 85910/week @ 2025-01-11 65286/week @ 2025-01-18

262,782 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