Skip to main content

TraceLog

Struct TraceLog 

Source
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

Source

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.

Source

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.

Source

fn to_jsonl_for(&self, kind: DumpKind) -> Result<String, String>

Serialise for kind.

§Errors

As the chosen serialisation.

Source

fn encode( &self, per_line: impl FnMut(&str) -> Result<String, String>, ) -> Result<String, String>

Source

pub fn inbound(&self) -> Vec<&str>

Slice of inbound lines (CLI → SDK).

Source

pub fn outbound(&self) -> Vec<&str>

Slice of outbound lines (SDK → CLI).

Trait Implementations§

Source§

impl Debug for TraceLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TraceLog

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more