pub struct LogEntry {
pub uuid: Option<String>,
pub timestamp: String,
pub level: Option<LogLevel>,
pub idle_pct: Option<String>,
pub source: Option<String>,
pub message: String,
pub kind: LineKind,
pub message_kind: MessageKind,
pub block: Option<Block>,
pub attached: AttachedLines,
pub line_number: u64,
pub warnings: Vec<ParseWarning>,
}Expand description
A complete parsed log entry with all context resolved.
Produced by LogStream. Continuation lines have been
grouped, UUID/timestamp inherited from context where needed, and
multi-line blocks reassembled.
Fields§
§uuid: Option<String>Session UUID; None for system lines (no channel context).
timestamp: StringTimestamp with microsecond precision; inherited from the previous entry for continuations.
level: Option<LogLevel>None for continuation and truncated lines.
idle_pct: Option<String>Core scheduler idle percentage; None for continuations.
source: Option<String>Source file:line; None for continuations.
message: StringThe primary message text.
kind: LineKindWhich line format originated this entry.
message_kind: MessageKindSemantic classification of the message content.
block: Option<Block>Typed, parsed multi-line block; None for entries without a trailing block.
attached: AttachedLinesRaw continuation lines that followed the primary line.
line_number: u641-based line number in the input stream.
warnings: Vec<ParseWarning>Per-entry warnings about parsing anomalies.
Implementations§
Source§impl LogEntry
impl LogEntry
Sourcepub fn fields(&self) -> Vec<Field>
pub fn fields(&self) -> Vec<Field>
Locate every field this entry carries, across its message and each raw attached line.
Recomputed per call and never stored — an entry nobody interrogates pays
nothing. Ranges index message or the
attached line named by Field::at, never a reassembled
Block; uuid is a field of the
entry rather than message text, so no span covers it.
Ordering within one location is message_fields’s; locations follow
the message, then attached lines in order.
Sourcepub fn render_with(
&self,
f: impl Fn(&Field, &str) -> Option<String>,
) -> Result<RenderedEntry, RenderError>
pub fn render_with( &self, f: impl Fn(&Field, &str) -> Option<String>, ) -> Result<RenderedEntry, RenderError>
Rewrite this entry’s fields, returning one string per render unit.
f is called with each field and the text it covers; None leaves it
as it was. The message and each attached line are rewritten separately
because they are separate texts — see apply_fields for how nested and
overlapping replacements resolve.
uuid, timestamp
and the rest of the header are entry fields rather than message text, so
a consumer rendering them handles them itself.
Source§impl LogEntry
impl LogEntry
Sourcepub fn synthetic(message: impl Into<String>) -> LogEntry
pub fn synthetic(message: impl Into<String>) -> LogEntry
An entry for output the parser never produced — a separator line between files or dates, or a hand-built test fixture. Carries no uuid, timestamp, level, source or block; override individual fields with struct-update syntax for callers that need one set.