fix: macOS 26 compatibility — replace OSLogStore with Process()-based log reader#209
Closed
llostinthesauce wants to merge 1 commit into
Closed
fix: macOS 26 compatibility — replace OSLogStore with Process()-based log reader#209llostinthesauce wants to merge 1 commit into
llostinthesauce wants to merge 1 commit into
Conversation
…()-based log reader The core fix: OSLogStore.local() causes 100% CPU usage on macOS 26+. Replace it with Process() spawning /usr/bin/log stream to read Apple Music log entries as a Combine stream. This is the approach from the v3 draft PR #201, cleaned up for a minimal, focused change. Also fixes: - Duplicate OutputDevices/MediaRemoteController instances: AppDelegate is now the single source of truth; MenuBarController receives a reference from AppDelegate instead of creating its own. - Removed unused OSLog imports from CMPlayerStuff and ContentView. - Console.getRecentEntries() stubbed out (OSLogStore removed). - Added OrderedCollections dependency (swift-collections 1.3.0). - Added helper models: CMEntry, AudioFormat, InfoPair. - Safer optional unwrap in AppVersion.swift.
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
OSLogStore.local()withProcess()-based log streaming (/usr/bin/log stream)OutputDevices/MediaRemoteControllerinstancesOrderedCollectionsdependency for efficient log-to-track pairingWhat Changed
Root Cause
On macOS 26 (Tahoe),
OSLogStore.local()causes 100% CPU usage and makes the app non-functional. This is documented in issues #183, #190, and #208.Fix: LogReader (Process-based log streaming)
New
LogReader.swiftusesProcess()to spawn/usr/bin/log streamwith a predicate targeting Apple Music'sampplaycategory. Log entries are parsed and published as a Combine stream. This is based on the approach in the v3 draft PR #201.Other Fixes
AppDelegatenow owns the singleOutputDevicesinstance;MenuBarControllerreceives it via setup. Previously both created their own instances, with only one wired to the UI.Console.getRecentEntries()is now a stub; OSLog imports removed fromCMPlayerStuff.swiftandContentView.swift.CMEntry,AudioFormat,InfoPairfor structured log entry parsing and track-format pairing.AppVersion.swiftuses optional chaining with defaults instead of force unwrap.Dependencies Added
swift-collections(1.3.0) — forOrderedDictionaryused in log-to-track pairingRelated Issues
Fixes #183, Fixes #190, Resolves #208
Testing
Built and tested on macOS 26.5 (Dev Beta 2). The log stream approach successfully reads Apple Music lossless track metadata without CPU spikes.