Skip to main content

LoggingProvider

Trait LoggingProvider 

Source
pub trait LoggingProvider<Ctx>: Send + Sync {
    // Provided methods
    fn on_start(_ctx: &Ctx, _tool_name: &str, _args: &Value) { ... }
    fn on_cache_hit(_ctx: &Ctx, _tool_name: &str, _args: &Value) { ... }
    fn on_success(
        _ctx: &Ctx,
        _tool_name: &str,
        _duration: Duration,
        _attempt: u32,
        _from_cache: bool,
    ) { ... }
    fn on_retry(
        _ctx: &Ctx,
        _tool_name: &str,
        _next_attempt: u32,
        _backoff: Duration,
        _error: &Error,
    ) { ... }
    fn on_failure(
        _ctx: &Ctx,
        _tool_name: &str,
        _duration: Duration,
        _attempt: u32,
        _error: &Error,
    ) { ... }
}
Expand description

Provider trait for execution logging and telemetry.

Provided Methods§

Source

fn on_start(_ctx: &Ctx, _tool_name: &str, _args: &Value)

Source

fn on_cache_hit(_ctx: &Ctx, _tool_name: &str, _args: &Value)

Source

fn on_success( _ctx: &Ctx, _tool_name: &str, _duration: Duration, _attempt: u32, _from_cache: bool, )

Source

fn on_retry( _ctx: &Ctx, _tool_name: &str, _next_attempt: u32, _backoff: Duration, _error: &Error, )

Source

fn on_failure( _ctx: &Ctx, _tool_name: &str, _duration: Duration, _attempt: u32, _error: &Error, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§