fix(logs): implement SwiftLog event handlers#1933
Open
stephenlclarke wants to merge 3 commits into
Open
Conversation
7 tasks
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.
Type of Change
Motivation and Context
Fixes #1754.
Supersedes #1758, whose deleted fork head cannot be reattached to the closed review.
Downstream packages can resolve a newer SwiftLog than this repository's current lockfile. SwiftLog 1.13.2 makes
log(event:)the primaryLogHandlerentry point, so relying on the compatibility bridge emits deprecation warnings for all threeContainerLoghandlers.This change updates the lockfile to SwiftLog 1.13.2 and implements the primary event entry point without changing the existing output format. Both SwiftLog entry points share the same private emission path, including handler metadata and per-event metadata merging.
What Changed
log(event:)forFileLogHandler,OSLogHandler, andStderrLogHandler.log(level:message:metadata:source:file:function:line:)compatibility entry point.ContainerLogTestsand exercises all three primary event paths.The branch keeps dependency, implementation, and test changes in separate commits.
Testing
Validation:
make swift-fmt-checkmake test: 94 XCTest cases and 559 Swift Testing cases passedswift test --disable-automatic-resolution --enable-code-coverage --filter ContainerLogHandlerTestsswift build --disable-automatic-resolution --target ContainerLoggit diff --check origin/main..HEADThe coverage run executes each new
log(event:)entry point and asserts the observable file-handler behavior.