Struct spdlog::sink::AsyncPoolSink
source · pub struct AsyncPoolSink { /* private fields */ }
Available on crate feature
multi-thread
only.Expand description
A combined sink, logging and flushing asynchronously (thread-pool-based).
This sink sends log
and flush
operations to the inside thread pool for
asynchronous processing.
Note
Errors that occur in log
and flush
will not be returned directly,
instead the error handler will be called.
Examples
See ./examples directory.
Implementations
sourceimpl AsyncPoolSink
impl AsyncPoolSink
sourcepub fn builder() -> AsyncPoolSinkBuilder
pub fn builder() -> AsyncPoolSinkBuilder
Constructs a builder of AsyncPoolSink
.
sourcepub fn sinks(&self) -> &[Arc<dyn Sink>]
pub fn sinks(&self) -> &[Arc<dyn Sink>]
Gets a reference to internal sinks in the combined sink.
sourcepub fn set_error_handler(&self, handler: Option<ErrorHandler>)
pub fn set_error_handler(&self, handler: Option<ErrorHandler>)
Sets a error handler.
Trait Implementations
sourceimpl Sink for AsyncPoolSink
impl Sink for AsyncPoolSink
sourcefn set_formatter(&self, formatter: Box<dyn Formatter>)
fn set_formatter(&self, formatter: Box<dyn Formatter>)
For AsyncPoolSink
, the function performs the same call to all
internal sinks.
sourcefn level_filter(&self) -> LevelFilter
fn level_filter(&self) -> LevelFilter
Gets the log level filter.
sourcefn set_level_filter(&self, level_filter: LevelFilter)
fn set_level_filter(&self, level_filter: LevelFilter)
Sets the log level filter.
sourcefn set_error_handler(&self, handler: Option<ErrorHandler>)
fn set_error_handler(&self, handler: Option<ErrorHandler>)
Sets a error handler. Read more
sourcefn should_log(&self, level: Level) -> bool
fn should_log(&self, level: Level) -> bool
Determines if a log message with the specified level would be logged.
Auto Trait Implementations
impl !RefUnwindSafe for AsyncPoolSink
impl Send for AsyncPoolSink
impl Sync for AsyncPoolSink
impl Unpin for AsyncPoolSink
impl !UnwindSafe for AsyncPoolSink
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more