Struct tracing_web::MakeWebConsoleWriter
source · 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
§type Writer = ConsoleWriter
type Writer = ConsoleWriter
The concrete
io::Write
implementation returned by make_writer
.Auto Trait Implementations§
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 verbosethan
Level::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>where
Self: Sized,
F: Fn(&Metadata<'_>) -> bool,
fn with_filter<F>(self, filter: F) -> WithFilter<Self, F>where Self: Sized, F: Fn(&Metadata<'_>) -> bool,
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>where
Self: MakeWriter<'a, Writer = EitherWriter<W, Sink>> + Sized,
B: MakeWriter<'a>,
W: Write,
fn or_else<W, B>(self, other: B) -> OrElse<Self, B>where Self: MakeWriter<'a, Writer = EitherWriter<W, Sink>> + Sized, B: MakeWriter<'a>, W: Write,
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