pub struct Printer<F, W> { /* private fields */ }
Expand description
A Processor
that formats and writes logs.
Implementations§
Source§impl Printer<Pretty, MakeStdout>
impl Printer<Pretty, MakeStdout>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Returns a new PrettyPrinter
that pretty-prints to stdout.
Use Printer::formatter
and Printer::writer
for custom configuration.
Source§impl<F, W> Printer<F, W>where
F: 'static + Formatter,
W: 'static + for<'a> MakeWriter<'a>,
impl<F, W> Printer<F, W>where
F: 'static + Formatter,
W: 'static + for<'a> MakeWriter<'a>,
Trait Implementations§
Source§impl<F, W> Processor for Printer<F, W>where
F: 'static + Formatter,
W: 'static + for<'a> MakeWriter<'a>,
impl<F, W> Processor for Printer<F, W>where
F: 'static + Formatter,
W: 'static + for<'a> MakeWriter<'a>,
Source§fn or<P: Processor>(self, processor: P) -> WithFallback<Self, P>
fn or<P: Processor>(self, processor: P) -> WithFallback<Self, P>
Returns a
Processor
that first attempts processing with self
, and
resorts to processing with fallback
on failure. Read moreSource§fn or_stdout(self) -> WithFallback<Self, Printer<Pretty, MakeStdout>>
fn or_stdout(self) -> WithFallback<Self, Printer<Pretty, MakeStdout>>
Returns a
Processor
that first attempts processing with self
, and
resorts to pretty-printing to stdout on failure.Source§fn or_stderr(self) -> WithFallback<Self, Printer<Pretty, MakeStderr>>
fn or_stderr(self) -> WithFallback<Self, Printer<Pretty, MakeStderr>>
Returns a
Processor
that first attempts processing with self
, and
resorts to pretty-printing to stderr on failure.Source§fn or_none(self) -> WithFallback<Self, Sink>
fn or_none(self) -> WithFallback<Self, Sink>
Returns a
Processor
that first attempts processing with self
, otherwise
silently fails.Auto Trait Implementations§
impl<F, W> Freeze for Printer<F, W>
impl<F, W> RefUnwindSafe for Printer<F, W>where
F: RefUnwindSafe,
W: RefUnwindSafe,
impl<F, W> Send for Printer<F, W>
impl<F, W> Sync for Printer<F, W>
impl<F, W> Unpin for Printer<F, W>
impl<F, W> UnwindSafe for Printer<F, W>where
F: UnwindSafe,
W: UnwindSafe,
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