Skip to main content

Module tracefmt

Module tracefmt 

Source
Expand description

Renders tracing-subscriber JSON-lines records to styled Cells.

This is a separate, self-contained renderer for the trace stream kind — it does not go through trace-stream/Pipeline; that pipeline is a markdown/DSML renderer for model token streams and is the wrong tool for a structured log line.

One input line (JSON or not) becomes one output line:

12:04:01  WARN  myapp::db   retry  attempt=3
└ dim ┘  └level┘ └ cyan ─┘  └msg┘  └ dim ┘

A line that fails to parse as JSON is rendered verbatim in the default attribute rather than dropped or reported as an error — a producer will eventually emit a panic message or a stray println!, and losing it would be worse than showing it unstyled.

Structs§

TraceRenderer
Buffers a trace session’s incoming bytes into lines and renders each one into the view, exactly as crate::pipeline::Pipeline does for a tokens session – but through render_line instead of trace-stream.

Functions§

render_line
Renders one line of a trace stream: a JSON tracing-subscriber record, or – if the line is not valid JSON, or lacks a recognized level – verbatim in the default attribute.