pub struct MakeWebConsoleWriter { /* private fields */ }Expand description
A MakeWriter emitting the written text to the console.
The used log method is sensitive to the level the event is emitted with.
| Level | Method |
|---|---|
| TRACE | console.debug |
| DEBUG | console.debug |
| INFO | console.info |
| WARN | console.warn |
| ERROR | console.error |
| other | console.log |
Implementations§
Source§impl MakeWebConsoleWriter
impl MakeWebConsoleWriter
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a default console writer, i.e. no level annotation is shown when logging a message.
Sourcepub fn with_pretty_level(self) -> Self
pub fn with_pretty_level(self) -> Self
Enables an additional label for the log level to be shown.
It is recommended that you also use Layer::with_level(false) if you use this option, to avoid the event level being shown twice.
Trait Implementations§
Source§impl Default for MakeWebConsoleWriter
impl Default for MakeWebConsoleWriter
Source§impl<'a> MakeWriter<'a> for MakeWebConsoleWriter
impl<'a> MakeWriter<'a> for MakeWebConsoleWriter
Source§type Writer = ConsoleWriter
type Writer = ConsoleWriter
The concrete
io::Write implementation returned by make_writer.Auto Trait Implementations§
impl Freeze for MakeWebConsoleWriter
impl RefUnwindSafe for MakeWebConsoleWriter
impl Send for MakeWebConsoleWriter
impl Sync for MakeWebConsoleWriter
impl Unpin for MakeWebConsoleWriter
impl UnwindSafe for MakeWebConsoleWriter
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
Source§impl<'a, M> MakeWriterExt<'a> for Mwhere
M: MakeWriter<'a>,
impl<'a, M> MakeWriterExt<'a> for Mwhere
M: MakeWriter<'a>,
Source§fn with_max_level(self, level: Level) -> WithMaxLevel<Self>where
Self: Sized,
fn with_max_level(self, level: Level) -> WithMaxLevel<Self>where
Self: Sized,
Wraps
self and returns a MakeWriter that will only write output
for events at or below the provided verbosity Level. For instance,
Level::TRACE is considered to be _more verbosethanLevel::INFO`. Read moreSource§fn with_min_level(self, level: Level) -> WithMinLevel<Self>where
Self: Sized,
fn with_min_level(self, level: Level) -> WithMinLevel<Self>where
Self: Sized,
Wraps
self and returns a MakeWriter that will only write output
for events at or above the provided verbosity Level. Read moreSource§fn with_filter<F>(self, filter: F) -> WithFilter<Self, F>
fn with_filter<F>(self, filter: F) -> WithFilter<Self, F>
Wraps
self with a predicate that takes a span or event’s Metadata
and returns a bool. The returned MakeWriter’s
MakeWriter::make_writer_for method will check the predicate to
determine if a writer should be produced for a given span or event. Read moreSource§fn and<B>(self, other: B) -> Tee<Self, B>where
Self: Sized,
B: MakeWriter<'a>,
fn and<B>(self, other: B) -> Tee<Self, B>where
Self: Sized,
B: MakeWriter<'a>,
Combines
self with another type implementing MakeWriter, returning
a new MakeWriter that produces writers that write to both
outputs. Read moreSource§fn or_else<W, B>(self, other: B) -> OrElse<Self, B>
fn or_else<W, B>(self, other: B) -> OrElse<Self, B>
Combines
self with another type implementing MakeWriter, returning
a new MakeWriter that calls other’s make_writer if self’s
make_writer returns OptionalWriter::none. Read more