Skip to content

fix: respect PartsExclude in writeFields#767

Open
ricardbejarano wants to merge 1 commit into
rs:masterfrom
bejaratommy:fix/parts-exclude-in-write-fields
Open

fix: respect PartsExclude in writeFields#767
ricardbejarano wants to merge 1 commit into
rs:masterfrom
bejaratommy:fix/parts-exclude-in-write-fields

Conversation

@ricardbejarano

Copy link
Copy Markdown

Summary

Fields listed in PartsExclude were only excluded from writePart (which handles standard fields like level, time, message, and custom fields rendered via PartsOrder), but were still rendered by writeFields, causing them to appear in the trailing key=value section of the output.

This PR fixes writeFields to also skip fields listed in PartsExclude.

Related Issue

Fixes #722

Changes

  • console.go: In writeFields, skip any field that is listed in PartsExclude
  • console_test.go: Add test verifying that PartsExclude suppresses fields from both writePart and writeFields

Fields listed in PartsExclude were only excluded from writePart
(standard fields rendered via PartsOrder), but were still rendered
by writeFields, causing them to appear in the trailing key=value
section of the output.

Fix writeFields to also skip fields listed in PartsExclude.

Fixes rs#722

Signed-off-by: Tommy <tommy@bejarano.io>
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.

ConsoleWriter seems to ignore PartsExclude and FormatExtra

1 participant