Skip to main content

Crate zeroclaw_log

Crate zeroclaw_log 

Expand description

Unified log emission surface for the ZeroClaw workspace.

Re-exports§

pub use broadcast::LogBroadcastSender;
pub use broadcast::clear_broadcast_hook;
pub use broadcast::current_broadcast_hook;
pub use broadcast::set_broadcast_hook;
pub use broadcast::subscribe;
pub use chain::display_chain;
pub use config::LlmRequestPayloadPolicy;
pub use config::LogConfig;
pub use config::ResolvedPolicy;
pub use config::StoragePolicy;
pub use config::ToolIoPolicy;
pub use event::ATTRIBUTION_FIELDS;
pub use event::Action;
pub use event::COMPOSITE_PREFIXES;
pub use event::Event;
pub use event::EventCategory;
pub use event::EventOutcome;
pub use event::LogEvent;
pub use event::Severity;
pub use event::ZeroclawAttribution;
pub use event::is_attribution_field;
pub use event::severity_text_from_number;
pub use event::severity_text_from_tracing_level;
pub use layer::LogCaptureLayer;
pub use writer::EPHEMERAL_BROADCAST_MARKER;
pub use writer::frame_carries_ephemeral_credentials;
pub use writer::strip_ephemeral_broadcast_marker;
pub use migrate::migrate_legacy_jsonl_in_place;
pub use observer_bridge::clear_observer_bridge;
pub use observer_bridge::set_observer_bridge;
pub use reader::LogFilter;
pub use reader::LogPage;
pub use reader::current_log_path;
pub use reader::find_event_by_id;
pub use reader::load_page;
pub use tool_io::ToolIoCapture;
pub use tool_io::capture_llm_request;
pub use tool_io::capture_tool_input;
pub use tool_io::capture_tool_output;
pub use writer::flush_for_test;
pub use writer::init_from_config;
pub use writer::llm_request_payload_policy;
pub use writer::record_event;
pub use writer::runtime_trace_path;

Modules§

broadcast
Process-wide broadcast channel for the canonical log stream.
chain
Anyhow error-chain rendering helper.
config
Policy types parsed from the runtime’s observability config.
event
field
Span field helpers (e.g. field::Empty for fields that get recorded later via span.record(...)).
layer
tracing-subscriber Layer that captures record! emissions and attribution_span! spans, assembling alias-bound LogEvents and routing them to JSONL persistence, the broadcast hook, and the Observer bridge.
migrate
One-shot, streaming, in-place migration from schema_version 1 rows to schema_version 2.
observer_bridge
Observer bridge — projects crate::LogEvents onto the typed [zeroclaw_api::observability_traits::ObserverEvent] variants when a bound observer is installed.
reader
Paginated stream reader for the JSONL log file.
tool_io
Tool input/output capture: leak-scan + truncation + denylist.
writer
JSONL append-only writer + rolling rotation.

Macros§

attribution_span
debug_span
Ad-hoc span constructors. Prefer attribution_span!(thing) when the field set comes from an Attributable impl; reach for these only when the work doesn’t tie to a role. Constructs a span at the debug level.
error_span
Ad-hoc span constructors. Prefer attribution_span!(thing) when the field set comes from an Attributable impl; reach for these only when the work doesn’t tie to a role. Constructs a span at the error level.
info_span
Ad-hoc span constructors. Prefer attribution_span!(thing) when the field set comes from an Attributable impl; reach for these only when the work doesn’t tie to a role. Constructs a span at the info level.
record
Emit a structured ZeroClaw log event. The single positional Event expression carries the typed payload; the trailing literal is the human-readable message.
scope
trace_span
Ad-hoc span constructors. Prefer attribution_span!(thing) when the field set comes from an Attributable impl; reach for these only when the work doesn’t tie to a role. Constructs a span at the trace level.
warn_span
Ad-hoc span constructors. Prefer attribution_span!(thing) when the field set comes from an Attributable impl; reach for these only when the work doesn’t tie to a role. Constructs a span at the warn level.

Structs§

Span
Opaque span handle. Same wire format as tracing::Span (we re-export the type) but the public path is zeroclaw_log::Span — no tracing in any consumer’s source. A handle representing a span, with the capability to enter the span if it exists.

Traits§

Instrument
Future combinator that attaches a Span to the future. Use as future.instrument(span).await at entry points. Attaches spans to a std::future::Future.

Functions§

debug_enabled
Returns whether ZeroClaw DEBUG log events are enabled for the current subscriber. Use this before building expensive structured DEBUG attrs.
install_global_subscriber