Make ConsoleLogger Apple-only for non-Apple builds#7
Closed
leogdion wants to merge 2 commits into
Closed
Conversation
ConsoleLogger imported OSLog unconditionally, breaking non-Apple builds (`no such module 'OSLog'`). Wrap the whole type in `#if canImport(OSLog)` so it stays OSLog-backed on Apple platforms and is simply unavailable where OSLog can't be imported (e.g. Linux). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Closing: the head repo (brightdigit/Broadcast) was detached from the fork network, so this PR is stuck on a stale base and can't update. Recreating from a freshly re-forked brightdigit/Broadcast — replacement link to follow. |
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
ConsoleLoggerimportedOSLogunconditionally, which breaks non-Apple builds withno such module 'OSLog'(e.g. Linux). This wraps the whole type — the import, theLogger-backed implementation, and theOSLogTypemapping — in#if canImport(OSLog).The result:
ConsoleLoggerstays backed by Apple's unified logging system (Console.app / Xcode / OSLog tools) on Apple platforms, and is simply unavailable on platforms without OSLog — no separate code path to maintain.Notes
Sources/Broadcast/Loggers/ConsoleLogger.swift).MultiSessionLoggingpackage trait) prunes the Boutique dependency, which is what fully unblocks dependency resolution on Linux; both together reproduce Fixing WatchOS Support and Non-Apple Builds #6's state.🤖 Generated with Claude Code