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

OptionsBuilder provides a builder-style interface to construct an Options.

Implementations

Construct a new OptionsBuilder, which by default just sets the options to their default values.

Set the filters which will be applied to any logging calls before actually logging them.

Set the output factory the Logger should use. This can be used to redirect logging output more generically, although for the common case set_output_to might be easier to use.

Configure the Logger to write its log output to the given Write implementation (e.g. a File). This is a convenience function which just calls set_output_factory under the hood.

Set whether or not the Logger should panic! if writing log output fails. Generally this can be useful for debugging, but in real production code losing a log entry might not be a good enough reason to terminate the entire process.

Set whether or not the Logger should flush its output after every logging call. The benefit is that log messages show up immediately, and are less susceptible to “corruption” when logging from multiple threads, but the cost is a significant performance penalty for all logging calls.

Build an Options structure from this builder’s current state. This might return an error if no custom filters were specified, and attempting to retrieve filters from an environment variable fails.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more