Repository navigation
1.0.1: keep ANSI out of span-field caches - #7
Merged
Merged
Conversation
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
force-pushed
the
unify-logging
branch
from
August 21, 2026 16:58
c1f639e to
047387c
Compare
LogicOcean
enabled auto-merge (squash)
August 21, 2026 16:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.