Expand description
Flow-level debug logging utilities.
At most one global listener can be registered. When no listener is present,
emit/emit_lazy return quickly with minimal overhead. Listener panics are
isolated with catch_unwind so SDK internal logic remains safe.
§Log levels and persistence
Consumers register a single listener via set_debug_log_listener and
receive every Log the SDK emits. Each entry carries a LogLevel that
tells the consumer how to treat it. Use LogLevel::persist_recommended to
decide what to keep:
| Level | Meaning | Persist? |
|---|---|---|
LogLevel::Trace | per-chunk / per-poll / per-retry hot-loop noise | No — drop or sample only |
LogLevel::Debug | low-volume diagnostics | optional / short-term only |
LogLevel::Info | normal operational information | optional |
LogLevel::Key | key-node checkpoint for troubleshooting | Yes — keep and forward to the SDK author |
LogLevel::Warn | recoverable anomaly / misuse / backpressure | Yes |
LogLevel::Error | failure with full detail, or a caught panic | Yes |
The author-forwardable troubleshooting stream is everything at
>= LogLevel::Key, i.e. Key | Warn | Error. Never persist a high-frequency
Trace entry, and never persist any URL or task dump that has not been run
through sanitize_url.
Structs§
- Debug
LogListener Error - Log
- One structured log record that can be printed or persisted externally.
Enums§
- LogLevel
- Log severity level for flow debug entries.
Functions§
- debug_
log_ listener_ active - Returns whether a debug log listener is currently registered.
- emit
- Emits one log entry.
- emit_
lazy - Lazily emits a log entry only when listener is active.
- redact_
secrets - Redacts secret
key=valuepairs (signatures, credentials, security tokens, access keys) from arbitrary free text — an error chain message, or a provider response body that may echo a signed URL — so the text is safe to log. - sanitize_
url - Redacts secret query parameters from a URL so it is safe to log or persist.
- set_
debug_ log_ listener - Sets or clears the global debug log listener.
- try_
set_ debug_ log_ listener - Registers a global singleton debug log listener.
Type Aliases§
- Debug
LogListener - Callback type for global debug log listener.