SinkPropAccess

Trait SinkPropAccess 

Source
pub trait SinkPropAccess {
    // Required methods
    fn level_filter(&self) -> LevelFilter;
    fn set_level_filter(&self, level_filter: LevelFilter);
    fn set_formatter(&self, formatter: Box<dyn Formatter>);
    fn set_error_handler(&self, handler: ErrorHandler);
}
Expand description

Represents getters for properties of a sink.

The use of a sink requires these properties, and this trait describes the methods for getting them.

For the common case of custom sinks, users don’t need to implement this trait manually, they can just store a SinkProp in their sink struct and implement trait GetSinkProp, a blanket implementation will automatically implement SinkPropAccess for the sink.

For more details on implementing custom sink, see [. /examples] directory.

Required Methods§

Source

fn level_filter(&self) -> LevelFilter

Gets the log level filter.

Source

fn set_level_filter(&self, level_filter: LevelFilter)

Sets the log level filter.

Source

fn set_formatter(&self, formatter: Box<dyn Formatter>)

Sets the formatter.

Source

fn set_error_handler(&self, handler: ErrorHandler)

Sets a error handler.

Most errors that occur in Sink will be returned as directly as possible (e.g. returned to Logger), but some errors that cannot be returned immediately, this function will be called. For example, asynchronous errors.

Implementors§

Source§

impl SinkPropAccess for AsyncPoolSink

Available on crate feature multi-thread only.
Source§

impl<S: GetSinkProp> SinkPropAccess for S