[−][src]Crate slog_logfmt
slog_logfmt
- a logfmt
formatter for slog.
This crate exposes a slog
drain that formats messages as logfmt.
Example
use slog_logfmt::Logfmt; use slog::{debug, o, Drain, Logger}; use std::io::stdout; let drain = Logfmt::new(stdout()).build().fuse(); let drain = slog_async::Async::new(drain).build().fuse(); let logger = Logger::root(drain, o!("logger" => "tests")); debug!(logger, #"tag", "hi there"; "foo" => "bar'baz\"");
Writes:
DEBG | #tag hi there logger="tests" foo="bar\'baz\""
Structs
Logfmt | A drain & formatter for logfmt-formatted messages. |
LogfmtBuilder | A constructor for a |
Enums
Redaction | A decision on whether to print a key/value pair. |