pub struct MakeConsoleWriter(/* private fields */);
Expand description
This is the main type that is passed to with_writer
.
Note that you can map the tracing levels to different console
verbosity levels. This is especially useful for mapping
tracing::Level::TRACE
to a different console level,
such as debug
, to avoid all trace
tracing events
showing up in the browser’s console with their backtrace
expanded.
Implementations§
Source§impl MakeConsoleWriter
impl MakeConsoleWriter
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new MakeConsoleWriter
with the default MappedLevels
.
Sourcepub fn from_mapped_levels(mapped_levels: MappedLevels) -> Self
pub fn from_mapped_levels(mapped_levels: MappedLevels) -> Self
Creates a new MakeConsoleWriter
with a custom MappedLevels
.
Sourcepub fn map_trace_level_to(self, level: Level) -> Self
pub fn map_trace_level_to(self, level: Level) -> Self
Maps the tracing::Level::TRACE
to another console level.
Sourcepub fn map_debug_level_to(self, level: Level) -> Self
pub fn map_debug_level_to(self, level: Level) -> Self
Maps the tracing::Level::DEBUG
to another console level.
Sourcepub fn map_info_level_to(self, level: Level) -> Self
pub fn map_info_level_to(self, level: Level) -> Self
Maps the tracing::Level::INFO
to another console level.
Sourcepub fn map_warn_level_to(self, level: Level) -> Self
pub fn map_warn_level_to(self, level: Level) -> Self
Maps the tracing::Level::WARN
to another console level.
Sourcepub fn map_error_level_to(self, level: Level) -> Self
pub fn map_error_level_to(self, level: Level) -> Self
Maps the tracing::Level::ERROR
to another console level.
Trait Implementations§
Source§impl Clone for MakeConsoleWriter
impl Clone for MakeConsoleWriter
Source§fn clone(&self) -> MakeConsoleWriter
fn clone(&self) -> MakeConsoleWriter
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MakeConsoleWriter
impl Debug for MakeConsoleWriter
Source§impl Default for MakeConsoleWriter
impl Default for MakeConsoleWriter
Source§fn default() -> MakeConsoleWriter
fn default() -> MakeConsoleWriter
Returns the “default value” for a type. Read more
Source§impl From<MappedLevels> for MakeConsoleWriter
impl From<MappedLevels> for MakeConsoleWriter
Source§fn from(mapped_levels: MappedLevels) -> Self
fn from(mapped_levels: MappedLevels) -> Self
Converts to this type from the input type.
Source§impl<'a> MakeWriter<'a> for MakeConsoleWriter
impl<'a> MakeWriter<'a> for MakeConsoleWriter
Source§type Writer = ConsoleWriter
type Writer = ConsoleWriter
The concrete
io::Write
implementation returned by make_writer
.impl Copy for MakeConsoleWriter
Auto Trait Implementations§
impl Freeze for MakeConsoleWriter
impl RefUnwindSafe for MakeConsoleWriter
impl Send for MakeConsoleWriter
impl Sync for MakeConsoleWriter
impl Unpin for MakeConsoleWriter
impl UnwindSafe for MakeConsoleWriter
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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