Struct bdrck::logging::Options

source ·
pub struct Options {
    pub filters: LogFilters,
    pub max_level: LevelFilter,
    pub output_factory: LogOutputFactory,
    pub panic_on_output_failure: bool,
    pub always_flush: bool,
}
Expand description

Options is a structure which describes the options for a Logger. Generally these should be constructed using OptionsBuilder, instead of filling in all fields by hand.

Fields

filters: LogFilters

Filters controlling which log statements are enabled. If unspecified, defaults to the value of the RUST_LOG environment variable. If that is also unspecified, then by default all logging statements are enabled.

max_level: LevelFilter

The global maximum enabled logging level. This is basically the highest level configured in any of filters, or LevelFilter::Trace by default (meaning that all log messages are enabled, if no filters are specified).

output_factory: LogOutputFactory

Where to write log output to. If unspecified, defaults to stderr.

panic_on_output_failure: bool

Whether or not a log output (or flush) failure should result in a panic. Panicing is the “safest” option in some sense, but the default behavior is to silently ignore failures (under the assumption that most of the time users will want the application to continue working even if it can’t produce log output).

always_flush: bool

If true, always call flush() after each log statement. This has a significant negative impact on performance, but it does mean that log statements will appear immediately, which may be useful e.g. for debugging. By default, this feature is disabled.

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.