pub struct LoggingMiddleware { /* private fields */ }Expand description
Implementations§
Source§impl LoggingMiddleware
impl LoggingMiddleware
Sourcepub fn with_config(config: LoggingConfig) -> Self
pub fn with_config(config: LoggingConfig) -> Self
Create with custom configuration.
Sourcepub fn with_level(self, level: LogLevel) -> Self
pub fn with_level(self, level: LogLevel) -> Self
Set the log level.
Sourcepub fn with_params(self, enabled: bool) -> Self
pub fn with_params(self, enabled: bool) -> Self
Enable parameter logging.
Sourcepub fn with_response(self, enabled: bool) -> Self
pub fn with_response(self, enabled: bool) -> Self
Enable response logging.
Sourcepub fn with_slow_threshold(self, threshold_us: u64) -> Self
pub fn with_slow_threshold(self, threshold_us: u64) -> Self
Set slow query threshold in microseconds.
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Set the log prefix.
Sourcepub fn query_count(&self) -> u64
pub fn query_count(&self) -> u64
Get the total query count.
Trait Implementations§
Source§impl Default for LoggingMiddleware
impl Default for LoggingMiddleware
Source§impl Middleware for LoggingMiddleware
impl Middleware for LoggingMiddleware
Source§fn handle<'a>(
&'a self,
ctx: QueryContext,
next: Next<'a>,
) -> BoxFuture<'a, MiddlewareResult<QueryResponse>>
fn handle<'a>( &'a self, ctx: QueryContext, next: Next<'a>, ) -> BoxFuture<'a, MiddlewareResult<QueryResponse>>
Handle a query, optionally calling the next handler.
Auto Trait Implementations§
impl !Freeze for LoggingMiddleware
impl RefUnwindSafe for LoggingMiddleware
impl Send for LoggingMiddleware
impl Sync for LoggingMiddleware
impl Unpin for LoggingMiddleware
impl UnwindSafe for LoggingMiddleware
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more