Trait opendal::layers::LoggingInterceptor

source ·
pub trait LoggingInterceptor: Debug + Clone + Send + Sync + Unpin + 'static {
    // Required method
    fn log(
        &self,
        info: &AccessorInfo,
        operation: Operation,
        context: &[(&str, &str)],
        message: &str,
        err: Option<&Error>,
    );
}
Expand description

LoggingInterceptor is used to intercept the log.

Required Methods§

source

fn log( &self, info: &AccessorInfo, operation: Operation, context: &[(&str, &str)], message: &str, err: Option<&Error>, )

Everytime there is a log, this function will be called.

§Inputs
  • info: The service’s access info.
  • operation: The operation to log.
  • context: Additional context of the log like path, etc.
  • message: The log message.
  • err: The error to log.
§Note

Users should avoid calling resource-intensive operations such as I/O or network functions here, especially anything that takes longer than 10ms. Otherwise, Opendal could perform unexpectedly slow.

Object Safety§

This trait is not object safe.

Implementors§