pub struct LogEvent {
pub id: String,
pub timestamp: String,
pub severity_number: u8,
pub severity_text: String,
pub event: EventDescriptor,
pub service: ServiceDescriptor,
pub trace_id: Option<String>,
pub span_id: Option<String>,
pub zeroclaw: ZeroclawAttribution,
pub message: Option<String>,
pub attributes: Value,
pub schema_version: u8,
}Expand description
One row in the canonical log stream.
Fields§
§id: StringPersistent event id. UUID v4.
timestamp: StringRFC 3339 UTC timestamp with milliseconds. Keyed @timestamp to
match ECS conventions; consumers (and our paginated reader) sort
by this lexicographically, which works because RFC 3339 is sortable
as a string.
severity_number: u8§severity_text: String§event: EventDescriptor§service: ServiceDescriptor§trace_id: Option<String>Per-turn trace identifier so multiple events from one agent turn group together in the UI. Hex string; populated by the agent loop at run() entry.
span_id: Option<String>Sub-span within a turn (e.g. one tool call inside a multi-tool iteration).
zeroclaw: ZeroclawAttributionAll the alias-bound attribution fields live here.
message: Option<String>Human-readable short message. The structured fields above carry the
machine-readable detail; message is what a terminal-formatter
prints as the line body.
attributes: ValueFree-form structured payload. Per-action contributors put extra
data here (tokens used, iteration counter, tool input/output
payloads when log_tool_io is enabled, anyhow error chain when
the event is an error, …).
schema_version: u8Schema version. 2 = this struct. Older files containing version-1
rows get migrated in place at daemon startup.
Implementations§
Source§impl LogEvent
impl LogEvent
pub const SCHEMA_VERSION: u8 = 2
Sourcepub fn new(severity: Severity, action: &str, category: EventCategory) -> Self
pub fn new(severity: Severity, action: &str, category: EventCategory) -> Self
Build a fresh event with the given level + action + category. Caller fills in attribution and message before emission.