Struct slog_term::TermDecorator
source · [−]pub struct TermDecorator { /* private fields */ }
Expand description
Decorator
implemented using term
crate
This decorator will add nice formatting to the logs it’s outputting. It’s
based on term
crate.
It does not deal with serialization so is !Sync
. Run in a separate thread
with slog_async::Async
.
Implementations
sourceimpl TermDecorator
impl TermDecorator
sourcepub fn new() -> TermDecoratorBuilder
pub fn new() -> TermDecoratorBuilder
Start building TermDecorator
sourcepub fn level_to_color(level: Level) -> u16
pub fn level_to_color(level: Level) -> u16
Level
color
Standard level to Unix color conversion used by TermDecorator
Trait Implementations
sourceimpl Decorator for TermDecorator
impl Decorator for TermDecorator
sourcefn with_record<F>(
&self,
record: &Record<'_>,
_logger_values: &OwnedKVList,
f: F
) -> Result<()> where
F: FnOnce(&mut dyn RecordDecorator) -> Result<()>,
fn with_record<F>(
&self,
record: &Record<'_>,
_logger_values: &OwnedKVList,
f: F
) -> Result<()> where
F: FnOnce(&mut dyn RecordDecorator) -> Result<()>,
Get a RecordDecorator
for a given record
Read more
Auto Trait Implementations
impl !RefUnwindSafe for TermDecorator
impl Send for TermDecorator
impl !Sync for TermDecorator
impl Unpin for TermDecorator
impl !UnwindSafe for TermDecorator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more