pub struct TraceLog {
entries: Vec<(&'static str, String)>,
}Expand description
One captured line in a trace.
Fields§
§entries: Vec<(&'static str, String)>(direction, line) pairs in the order they happened on the wire.
Direction is "in" (CLI → SDK, from stdout) or "out" (SDK → CLI, to stdin).
Implementations§
Source§impl TraceLog
impl TraceLog
Sourcepub fn to_jsonl(&self) -> Result<String, String>
pub fn to_jsonl(&self) -> Result<String, String>
Serialise as JSONL: one {"dir":"in"|"out","line":"..."} per line,
redacting on the way out.
This is the redaction point for both live-capture write sites and
for baseline promotion, which copies the file this produces. Two
committed artifacts bypass it: the real_session_* baselines,
redacted harder by session_redact::redact_session_path, and
the reference captures under .claude/skills/claude-cli-upgrade/,
redacted by nothing.
§Errors
If any entry fails to serialise or cannot be redacted safely.
Sourcefn to_jsonl_verbatim(&self) -> Result<String, String>
fn to_jsonl_verbatim(&self) -> Result<String, String>
Serialise without redacting, for a diagnostic dump that is never promoted - a spawn failure is diagnosed from the real cwd.
§Errors
If any entry fails to serialise.