Struct Logger

Source
pub struct Logger<L: Log + 'static, F>
where F: Fn() -> u64 + Send + Sync + 'static,
{ /* private fields */ }
Expand description

A Logger that wraps other loggers to extend it with async functionality.

Implementations§

Source§

impl<L: Log + 'static, F> Logger<L, F>
where F: Fn() -> u64 + Send + Sync + 'static,

Source

pub fn wrap(logger: L, with: F) -> Self

Wrap an existing logger, extending it with async functionality.

Source

pub fn start(self, filter: LevelFilter) -> Result<(), SetLoggerError>

Start logging.

Trait Implementations§

Source§

impl<L: Debug + Log + 'static, F> Debug for Logger<L, F>
where F: Fn() -> u64 + Send + Sync + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L: Log, F> Log for Logger<L, F>
where F: Fn() -> u64 + Send + Sync + 'static,

Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
Source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
Source§

fn flush(&self)

Flushes any buffered records.

Auto Trait Implementations§

§

impl<L, F> Freeze for Logger<L, F>
where L: Freeze, F: Freeze,

§

impl<L, F> RefUnwindSafe for Logger<L, F>

§

impl<L, F> Send for Logger<L, F>

§

impl<L, F> Sync for Logger<L, F>

§

impl<L, F> Unpin for Logger<L, F>
where L: Unpin, F: Unpin,

§

impl<L, F> UnwindSafe for Logger<L, F>
where L: UnwindSafe, F: UnwindSafe,

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<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.