pub struct LogfmtFormat { /* private fields */ }Available on crate feature
logfmt only.Expand description
logfmt formatter. See module docs for the wire format.
§Example
use log_io::format::{Format, LogfmtFormat};
use log_io::{Field, Level, Metadata, Record, Value};
let fmt = LogfmtFormat::new();
let fields = [Field::new("port", Value::U64(8080))];
let record = Record::new(Metadata::new(Level::Info, "app"), "ok", &fields);
let mut out = String::new();
fmt.write_record(&record, &mut out).unwrap();
assert!(out.contains("port=8080"));
assert!(out.ends_with('\n'));Implementations§
Source§impl LogfmtFormat
impl LogfmtFormat
Trait Implementations§
Source§impl Clone for LogfmtFormat
impl Clone for LogfmtFormat
Source§fn clone(&self) -> LogfmtFormat
fn clone(&self) -> LogfmtFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogfmtFormat
impl Debug for LogfmtFormat
Source§impl Default for LogfmtFormat
impl Default for LogfmtFormat
Source§fn default() -> LogfmtFormat
fn default() -> LogfmtFormat
Returns the “default value” for a type. Read more
Source§impl Format for LogfmtFormat
impl Format for LogfmtFormat
impl Copy for LogfmtFormat
Auto Trait Implementations§
impl Freeze for LogfmtFormat
impl RefUnwindSafe for LogfmtFormat
impl Send for LogfmtFormat
impl Sync for LogfmtFormat
impl Unpin for LogfmtFormat
impl UnsafeUnpin for LogfmtFormat
impl UnwindSafe for LogfmtFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more