Struct StdLog

Source
pub struct StdLog;
Expand description

Drain logging Records into log crate

Using StdLog is effectively the same as using log::info!(...) and other standard logging statements.

Caution needs to be taken to prevent circular loop where Logger installed via slog-stdlog::set_logger would log things to a StdLog drain, which would again log things to the global Logger and so on leading to an infinite recursion.

Trait Implementations§

Source§

impl Drain for StdLog

Source§

type Error = Error

Type of potential errors returned during logging
Source§

fn log( &self, info: &Record<'_>, logger_values: &OwnedKeyValueList, ) -> Result<()>

Log one logging record Read more

Auto Trait Implementations§

§

impl Freeze for StdLog

§

impl RefUnwindSafe for StdLog

§

impl Send for StdLog

§

impl Sync for StdLog

§

impl Unpin for StdLog

§

impl UnwindSafe for StdLog

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<D> DrainExt for D
where D: Drain,

Source§

fn map_err<F, E>(self, f: F) -> MapError<Self, E>
where F: 'static + Sync + Send + Fn(Self::Error) -> E,

Map logging errors returned by this drain Read more
Source§

fn ignore_err(self) -> IgnoreErr<Self>

Make Self ignore and not report any error
Source§

fn fuse(self) -> Fuse<Self>
where Self::Error: Display,

Make Self panic when returning any errors
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.