AITrace.JSONL (AITrace v0.2.0)

Copy Markdown View Source

Append-only JSONL writer for trace events and receipts.

Summary

Functions

Appends one JSON-normalized event as a single line.

Encodes one event as a JSON line.

Normalizes atoms, tuples, lists, and maps into JSON-friendly values.

Functions

append(path, event)

@spec append(Path.t(), term()) :: :ok | {:error, term()}

Appends one JSON-normalized event as a single line.

encode_line(event)

@spec encode_line(term()) :: {:ok, String.t()} | {:error, term()}

Encodes one event as a JSON line.

normalize_for_json(value)

@spec normalize_for_json(term()) :: term()

Normalizes atoms, tuples, lists, and maps into JSON-friendly values.