Skip to content

[SLG-0005]: LogEvent LogHandler API proposal#424

Merged
kukushechkin merged 4 commits intomainfrom
SLG-0005-log-event-LogHandler-API
Mar 20, 2026
Merged

[SLG-0005]: LogEvent LogHandler API proposal#424
kukushechkin merged 4 commits intomainfrom
SLG-0005-log-event-LogHandler-API

Conversation

@kukushechkin
Copy link
Copy Markdown
Contributor

@kukushechkin kukushechkin commented Mar 9, 2026

Replace the flat-parameter log(level:message:metadata:source:file:function:line:) method on LogHandler with
log(event: LogEvent), enabling forward-compatible evolution of the LogHandler interface without breaking existing
handler implementations.

Motivation:

Changes to the LogHandler API require dance around creating new overloads, deprecating old overloads, which unnecessary bloats LogHandler protocol surface (like happened with the source: parameter). We have upcoming changes that would introduce new capabilities to the LogHandler protocol, for example https://forums.swift.org/t/proposal-slg-0003-standardized-error-metadata-via-logger-convenience/84518/35. It makes sense to introduce a single container structure for all the data associated with a log event before introducing any new overloads in LogHandler protocol.

Modifications:

  • SLG-0005 proposal added.

Result:

Proposal is ready for implementation.
The reason the proposal has

@kukushechkin kukushechkin added the semver/none No version bump required. label Mar 9, 2026
@kukushechkin kukushechkin force-pushed the SLG-0005-log-event-LogHandler-API branch from 2cddf68 to 540321e Compare March 19, 2026 14:37
@kukushechkin kukushechkin merged commit c9ceb51 into main Mar 20, 2026
57 checks passed
@kukushechkin kukushechkin deleted the SLG-0005-log-event-LogHandler-API branch March 20, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants