Skip to content

Comments

SLG-0004: Metadata privacy levels implementation#418

Draft
kukushechkin wants to merge 11 commits intoapple:mainfrom
kukushechkin:metadata-privacy-labels
Draft

SLG-0004: Metadata privacy levels implementation#418
kukushechkin wants to merge 11 commits intoapple:mainfrom
kukushechkin:metadata-privacy-labels

Conversation

@kukushechkin
Copy link
Contributor

This implements the SLG-0004 proposal introducing an attributed metadata system that allows attaching attributes to metadata values. Privacy level is the first concrete attribute, enabling developers to mark metadata values as .private or .public so LogHandler implementations can redact sensitive values before logging.

Motivation:

SwiftLog lacks a mechanism to attach attributes to metadata values as sensitive to allow Log Handlers to control logging behavior.

Modifications:

  • Attributed metadata added.
  • Privacy levels can be attached to Attributed Metadata via string interpolation.
  • Logger and LogHandler have new API surface for using Attributed Metadata.

Result:

Sensitive metadata values can be marked as .private to signal compatible Log Handlers to mask the value when logging.

@kukushechkin kukushechkin added the 🆕 semver/minor Adds new public API. label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant