Skip to main content

Module log_text

Module log_text 

Source
Expand description

Text helpers for parsing/rendering captured log lines.

Shared by the SDK’s microsandbox::sandbox::logs reader and the CLI’s msb logs renderer — both consume the same on-disk JSON Lines format and need the same low-level transforms.

Functions§

base64_decode
Decode a standard-alphabet base64 string. Returns None on malformed input. Used for the opt-in raw-mode e: "b64" log entries; small enough that pulling in the base64 crate isn’t justified.
split_leading_timestamp
Split a runtime.log/kernel.log line into a leading RFC 3339 timestamp token (ending in Z, ≥20 chars) and the rest of the line. Returns None if the first whitespace-delimited token isn’t a plausible timestamp.
strip_ansi
Strip ANSI escape sequences (CSI, OSC, two-byte C1).