Trait tk_pool::error_log::ErrorLog
[−]
[src]
pub trait ErrorLog { type ConnectionError; type SinkError; fn connection_error(&self, _addr: SocketAddr, _e: Self::ConnectionError) { ... } fn sink_error(&self, _addr: SocketAddr, _e: Self::SinkError) { ... } fn pool_shutting_down(&self, _reason: ShutdownReason) { ... } fn pool_closed(&self) { ... } }
The thrait that has appropriate hooks for logging different events
There is a default WarnLogger
, but the idea is that you may give
connection pool a name, change logging levels, and do other interesting
stuff in your own error log handler.
Associated Types
type ConnectionError
Connection error type that is returned by connect/hanshake function
type SinkError
Error when sending request returned by Sink
Provided Methods
fn connection_error(&self, _addr: SocketAddr, _e: Self::ConnectionError)
Error when establishing a new connection
fn sink_error(&self, _addr: SocketAddr, _e: Self::SinkError)
Error when sending a request
This also means connection is closed
fn pool_shutting_down(&self, _reason: ShutdownReason)
Pool is started to shut down for the specified reason
fn pool_closed(&self)
Pool is fully closed at this moment
Implementors
impl<C, S> ErrorLog for WarnLoggerInstance<C, S> where
C: Display,
S: Display, type ConnectionError = C; type SinkError = S;