Skip to content

fix(logs): resolve SwiftLog handler deprecation warnings for https://github.com/apple/container/issues/1754#1758

Closed
stephenlclarke wants to merge 2 commits into
apple:mainfrom
stephenlclarke:fix-loghandler-deprecation-warnings
Closed

fix(logs): resolve SwiftLog handler deprecation warnings for https://github.com/apple/container/issues/1754#1758
stephenlclarke wants to merge 2 commits into
apple:mainfrom
stephenlclarke:fix-loghandler-deprecation-warnings

Conversation

@stephenlclarke

@stephenlclarke stephenlclarke commented Jun 19, 2026

Copy link
Copy Markdown

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Fixes #1754.

Downstream packages can resolve a newer SwiftLog than this repository's current lockfile. SwiftLog 1.13.2 makes log(event:) the primary LogHandler entry point, so relying on the compatibility bridge emits deprecation warnings for all three ContainerLog handlers.

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

  • Updates SwiftLog from 1.10.1 to 1.13.2.
  • Implements log(event:) for FileLogHandler, OSLogHandler, and StderrLogHandler.
  • Preserves the existing log(level:message:metadata:source:file:function:line:) compatibility entry point.
  • Adds ContainerLogTests and exercises all three primary event paths.
  • Verifies that file output preserves the level and message and that event metadata overrides handler metadata.

The branch keeps dependency, implementation, and test changes in separate commits.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Validation:

  • make swift-fmt-check
  • make test: 94 XCTest cases and 559 Swift Testing cases passed
  • swift test --disable-automatic-resolution --enable-code-coverage --filter ContainerLogHandlerTests
  • swift build --disable-automatic-resolution --target ContainerLog
  • git diff --check origin/main..HEAD

The coverage run executes each new log(event:) entry point and asserts the observable file-handler behavior.

@stephenlclarke stephenlclarke force-pushed the fix-loghandler-deprecation-warnings branch from 4a2699b to ad62405 Compare June 22, 2026 08:44
@stephenlclarke stephenlclarke force-pushed the fix-loghandler-deprecation-warnings branch from ad62405 to ba2fc03 Compare June 24, 2026 15:49
@stephenlclarke stephenlclarke deleted the fix-loghandler-deprecation-warnings branch June 27, 2026 20:51
@stephenlclarke

Copy link
Copy Markdown
Author

Superseded by the current open, ready-for-review replacement #1933. The replacement is rebased on current Apple main and retains focused SwiftLog event-handler tests.

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.

[Bug]: Resolve SwiftLog LogHandler deprecation warnings in ContainerLog handlers

1 participant