Struct bdrck::logging::OptionsBuilder[][src]

pub struct OptionsBuilder { /* fields omitted */ }

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

Implementations

impl OptionsBuilder[src]

pub fn new() -> Self[src]

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

pub fn set_filters(mut self: Self, filters: LogFilters) -> Self[src]

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

pub fn set_output_factory(
    mut self: Self,
    output_factory: LogOutputFactory
) -> Self
[src]

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.

pub fn set_output_to<T: Write + Send + 'static>(self, output_writer: T) -> Self[src]

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.

pub fn set_panic_on_output_failure(
    mut self: Self,
    panic_on_output_failure: bool
) -> Self
[src]

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.

pub fn set_always_flush(mut self: Self, always_flush: bool) -> Self[src]

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.

pub fn build(self) -> Result<Options>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,