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
328,283 downloads per month
Used in 73 crates
(43 directly)
18KB
258 lines
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