Remove dead import OSLog from demo command files#134
Merged
Conversation
`import OSLog` is only needed where Swift Logging is bridged to OSLog — the `OSLogHandler` and `LoggingSystem.bootstrapWithOSLog()` helpers. The six demo subcommands and `MCPCommand` only *call* `bootstrapWithOSLog()`, which requires no OSLog import, so the import was dead (and it shadowed `Logging.Logger` with `os.Logger`). Drop the `#if canImport(OSLog) import OSLog #endif` blocks from those files, keeping the `#if canImport(OSLog)` guard around the Apple-only `bootstrapWithOSLog()` calls. `import OSLog` now appears only in the bridge files (OSLogHandler.swift / LoggingSystem.swift). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
import OSLogshould appear only where Swift Logging is bridged to OSLog — theOSLogHandlerandLoggingSystem.bootstrapWithOSLog()helpers. The six demo subcommands andMCPCommandonly callbootstrapWithOSLog(), which needs no OSLog import. The strayimport OSLogin those files was dead — and it shadowedLogging.Loggerwithos.Logger(the reason the lifecycle-logger lines neededLogging.Loggerqualification in #133).What changed
Removed the
#if canImport(OSLog) import OSLog #endifblocks from:MCPCommand,HTTPSSECommand,StdioCommand,TCPBonjourCommandHTTPSSECommand,StdioCommand,TCPBonjourCommandKept the
#if canImport(OSLog)guard around the Apple-onlybootstrapWithOSLog()calls.import OSLognow lives only in the bridge files (OSLogHandler.swift/LoggingSystem.swift).7 files, −22 lines, no functional change.
Verification
swift build(default traits) — green; the call sites compile without the import, proving it was deadgrep "import OSLog"→ only the 4 bridge files remain🤖 Generated with Claude Code