[−][src]Struct slog_logfmt::LogfmtBuilder
A constructor for a Logfmt
drain.
Methods
impl<W: Write> LogfmtBuilder<W>
[src]
pub fn build(self) -> Logfmt<W>
[src]
Constructs the drain.
pub fn set_prefix(
self,
prefix: fn(_: &mut dyn Write, _: &Record) -> Result
) -> Self
[src]
self,
prefix: fn(_: &mut dyn Write, _: &Record) -> Result
) -> Self
Set a function that prints a (not necessarily logfmt-formatted) prefix to the output stream.
pub fn no_prefix(self) -> Self
[src]
Sets the logger up to print no prefix, effectively starting the line entirely logfmt field-formatted.
pub fn redact(self, redact: fn(_: &Key) -> Redaction) -> Self
[src]
Sets a function that makes decisions on whether to log a field.
This function must return a Redaction
result, which has
two variants at the moment: Redact::Skip
to not log the
field, and Redact::Plain
to log the field value in plain
text.
pub fn print_msg(self, print: bool) -> Self
[src]
Choose whether to print the log message.
The default prefix already prints it, so the default is to skip.
pub fn print_level(self, print: bool) -> Self
[src]
Choose whether to print the log level.
The default prefix already prints it, so the default is to skip.
pub fn print_tag(self, print: bool) -> Self
[src]
Choose whether to print the log level.
The default prefix already prints it, so the default is to skip.
pub fn force_quotes(self) -> Self
[src]
Force quoting field values even if they don't contain quotable characters.
Setting this option will surround values with quotes like foo="bar"
.
Auto Trait Implementations
impl<W> RefUnwindSafe for LogfmtBuilder<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for LogfmtBuilder<W> where
W: Send,
W: Send,
impl<W> Sync for LogfmtBuilder<W> where
W: Sync,
W: Sync,
impl<W> Unpin for LogfmtBuilder<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for LogfmtBuilder<W> where
W: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,