pub struct TuiSlogDrain;Available on crate feature
slog-support only.Expand description
slog-compatible Drain that feeds messages to tui-logger.
§Basic usage:
use slog::{self, o, Drain, info};
//use tui_logger;
fn main() {
let drain = tui_logger::slog_drain().fuse();
let log = slog::Logger::root(drain, o!());
info!(log, "Logging via slog works!");
}Trait Implementations§
source§impl Drain for TuiSlogDrain
impl Drain for TuiSlogDrain
source§fn log(&self, info: &Record<'_>, logger_values: &OwnedKVList) -> Result<()>
fn log(&self, info: &Record<'_>, logger_values: &OwnedKVList) -> Result<()>
Handle one logging statement (
Record) Read moresource§fn is_enabled(&self, level: Level) -> bool
fn is_enabled(&self, level: Level) -> bool
Avoid: Check if messages at the specified log level are maybe
enabled for this logger. Read more
source§fn is_critical_enabled(&self) -> bool
fn is_critical_enabled(&self) -> bool
Avoid: See
is_enabledsource§fn is_error_enabled(&self) -> bool
fn is_error_enabled(&self) -> bool
Avoid: See
is_enabledsource§fn is_warning_enabled(&self) -> bool
fn is_warning_enabled(&self) -> bool
Avoid: See
is_enabledsource§fn is_info_enabled(&self) -> bool
fn is_info_enabled(&self) -> bool
Avoid: See
is_enabledsource§fn is_debug_enabled(&self) -> bool
fn is_debug_enabled(&self) -> bool
Avoid: See
is_enabledsource§fn is_trace_enabled(&self) -> bool
fn is_trace_enabled(&self) -> bool
Avoid: See
is_enabledsource§fn filter_level(self, level: Level) -> LevelFilter<Self>where
Self: Sized,
fn filter_level(self, level: Level) -> LevelFilter<Self>where
Self: Sized,
Filter logging records passed to
Drain (by level) Read moresource§fn map_err<F, E>(self, f: F) -> MapError<Self, E>
fn map_err<F, E>(self, f: F) -> MapError<Self, E>
Map logging errors returned by this drain Read more
source§fn ignore_res(self) -> IgnoreResult<Self>where
Self: Sized,
fn ignore_res(self) -> IgnoreResult<Self>where
Self: Sized,
Ignore results returned by this drain Read more
Auto Trait Implementations§
impl Freeze for TuiSlogDrain
impl RefUnwindSafe for TuiSlogDrain
impl Send for TuiSlogDrain
impl Sync for TuiSlogDrain
impl Unpin for TuiSlogDrain
impl UnwindSafe for TuiSlogDrain
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> 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<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more