Skip to content

1.0.1: keep ANSI out of span-field caches - #7

Merged
LogicOcean merged 1 commit into
mainfrom
unify-logging
Aug 21, 2026
Merged

LogicOcean merged 1 commit into
mainfrom
unify-logging

Conversation

@LogicOcean

Copy link
Copy Markdown
Owner

Found during the NSE API's adoption smoke run: span fields arrived in the log file wrapped in ANSI escape codes with colour off everywhere. The layer's own ANSI flag (default on) decides how span fields are cached, and the sinks only set the flag on the event format. Also gives file sinks their own span-field cache, so a coloured console can no longer bleed escape codes into a file. Both regressions pinned by tests that fail against 1.0.0.

Already published to crates.io as 1.0.1.

Found during the NSE API's adoption smoke run, not by the test suite:
the per-request span's fields (`http_request{method=…}`) arrived in the
log file and the colourless console wrapped in italic/dim escape codes,
with colour configured off on every sink.

The sinks set the ANSI flag on the event format only. Span fields never
go through the event format: the *layer's* flag — defaulting on —
decides how they are rendered into the cache that every event then
prints verbatim. The flag is now set on the layer for all four text
shapes.

The file sinks also get their own cache (a distinct field-formatter
type). Span-field caches are shared per formatter type, so a coloured
console beside a text file used to decide what the file printed —
the reason services turned console colour off to protect their files.
With a separate slot the file always caches plain and the console is
free to colour its own.

Both regressions are pinned by tests confirmed to fail against 1.0.0.

Verified: 273 tests all-features, 0 failures; clippy -D warnings clean.
@LogicOcean
LogicOcean enabled auto-merge (squash) August 21, 2026 16:58
@LogicOcean
LogicOcean merged commit 3825f6f into main Aug 21, 2026
3 checks passed
@LogicOcean
LogicOcean deleted the unify-logging branch August 21, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant