Skip to content

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

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

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

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. In container-compose, SwiftLog 1.13.2 emits deprecation warnings because the custom ContainerLog handlers rely on SwiftLog's deprecated default bridge for log(event:).

This PR keeps the change split into two reviewable commits:

  1. 09f2e5c chore: update swift-log lockfile
  2. 4a2699b fix(logs): implement SwiftLog event handlers

The first commit updates SwiftLog from 1.10.1 to 1.13.2. The second commit adds explicit log(event:) implementations for FileLogHandler, OSLogHandler, and StderrLogHandler.

The existing output formatting is preserved by routing both logging entry points through private helpers. The lockfile update is required because LogEvent is not available in SwiftLog 1.10.1.

Testing

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

Local validation:

  • swift build --disable-automatic-resolution --target ContainerLog
  • searched /tmp/container-log-build.log for deprecated default implementation, DeprecatedDeclaration, and warning:; no matches
  • git diff --check origin/main..HEAD

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