Skip to main content

set_debug_context_callback

Function set_debug_context_callback 

Source
pub fn set_debug_context_callback(
    callback: Box<dyn Fn() -> DebugContext + Send + Sync>,
)
Expand description

Set the debug context callback.

Called during panic to collect server logs and client dump paths. Can only be set once.

§Example

set_debug_context_callback(Box::new(|| {
    let server_logs = try_debug_ring().and_then(|r| r.try_dump());
    DebugContext {
        server_logs,
        client_dump_paths: Vec::new(),
    }
}));