Struct bflog::Logger

source ·
pub struct Logger {
    pub src: String,
    pub level: LevelFilter,
    pub sink: Weak<LogSink>,
    /* private fields */
}
Expand description

Sends log entries to a LogSink.

Fields§

§src: String

Source of the log entries from this logger.

This could be the module name, the application name, or any other string to categorize log entries on.

§level: LevelFilter

Maximum level of entries sent to the LogSink.

Set to LevelFilter::Off to not send any entries.

§sink: Weak<LogSink>

Sink to send entries to.

Implementations§

Creates a new Logger for the given LogSink.

The logger’s level will initially be set to the default level of the sink. The level can be changed to override the default.

Creates a new Logger with the same sink and level but with a new src.

Sets this logger as the logging implementation for the standard log crate.

Logs a message, with optional context, and sends it to the LogSink.

Logs a Trace level message with optional context.

Logs a Debug level message with optional context.

Logs an Info level message with optional context.

Logs a Warn level message with optional context.

Logs an Error level message with optional context.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.