pub struct Logger { /* private fields */ }
Expand description

A logger that plugs into OBS’s logging system.

Since OBS only has 4 logging levels and the lowest level is only enabled in debug builds of OBS, this logger provides a option to promote lower-level logs as info.

You can also use any other logger implementation, but we recommend this since OBS also writes everything in its logging system to a file, which can be viewed if there is a problem and OBS is not started from a console.

Examples

A new logger with default settings.

let _ = Logger::new().init();

Implementations

Creates a new logger with default levle set to Level::Trace and does not promote debug logs.

Initializes this logger, setting this as the global logger. This MUST be called to be effective. This may fail if there is already a logger.

Sets whether to promote Level::Debug and Level::Trace logs.

Sets the maximum logging level.

Trait Implementations

Returns the “default value” for a type. Read more

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

Logs the Record. Read more

Flushes any buffered records.

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