Merged
Conversation
- Add Log enum that writes to both os_log and Sentry - Support for debug/info/warning/error/fatal levels - Categories: app, device, gesture, analytics - Debug logs only appear in debug builds - Info/warning add Sentry breadcrumbs for crash context - Error/fatal also capture as Sentry events - Replace print() statements with Log calls in AnalyticsManager
- Remove custom file-based logging implementation - Use Log.debug for touch callbacks (device category) - Use Log.info for device start/stop lifecycle - Use Log.warning when device list is nil - Use Log.error when no multitouch device found - Reduce log frequency (every 500 touches vs 100)
- Log app start, initialization steps, and termination - Log accessibility permission status - Log preferences loading and updates - Provides breadcrumb trail for crash reports
- Log success/failure of launch at login configuration - Use Log.error with error context for failures - Log warning for unsupported macOS versions
Copilot started reviewing on behalf of
NullPointerDepressiveDisorder
December 4, 2025 03:40
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a unified logging system that replaces scattered print statements and custom file-based logging with a structured Log enum that writes to both Apple's os_log and Sentry for improved observability and error tracking.
- Adds a new
Logenum with five severity levels (debug, info, warning, error, fatal) that integrates with bothos_logand Sentry breadcrumbs/events - Removes the old file-based debug logger from
DeviceMonitorand replaces all print statements with structured log calls - Adds comprehensive logging to key application lifecycle events, device monitoring, analytics, and launch-at-login management
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| MiddleDrag/Utilities/AnalyticsManager.swift | Implements the new Log enum with os_log and Sentry integration; updates existing print statements to use Log.debug() and Log.warning() |
| MiddleDrag/Utilities/LaunchAtLoginManager.swift | Adds Log.info() for successful configuration and Log.error()/Log.warning() for failures and legacy macOS versions |
| MiddleDrag/Managers/MultitouchManager.swift | Replaces event tap creation warning with Log.warning() |
| MiddleDrag/Managers/DeviceMonitor.swift | Removes file-based debug logging; adds structured logs for device discovery, initialization, errors, and touch callbacks (sparsely logged for performance) |
| MiddleDrag/AppDelegate.swift | Adds comprehensive logging throughout app lifecycle including startup, preferences, multitouch manager initialization, accessibility permissions, and termination |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
Contributor
|
@NullPointerDepressiveDisorder I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: NullPointerDepressiveDisorder <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
…pr-4 Fix double registration of default multitouch device
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.
This pull request introduces a unified logging system via the new
Logenum, replacing scattered print/debug statements and custom file logging with structured logs sent to both the system log (os_log) and Sentry breadcrumbs/events. This improves observability, error tracking, and debugging across the app. The logging system is now used throughout the codebase, especially in app lifecycle, device monitoring, analytics, and launch-at-login management.Unified Logging Implementation
Logenum inAnalyticsManager.swift, providing methods for debug, info, warning, error, and fatal logs, all of which write toos_logand Sentry as appropriate.Logging Integration Across the App
DeviceMonitor.swiftwithLogcalls, including device startup, errors, and touch callback debug logs. Removed the old debug file logger. [1] [2] [3] [4]AppDelegate.swiftto log major lifecycle events and state changes, such as startup, preferences loading, multitouch manager initialization, accessibility permission status, and termination. [1] [2] [3] [4] [5]AnalyticsManager.swiftwith structured debug/info/warning logs, including initialization, event tracking, and error reporting. [1] [2] [3] [4] [5]LaunchAtLoginManager.swiftto useLogfor status and error reporting when enabling/disabling launch at login, including legacy macOS warnings.Other Logging Improvements
printwarning inMultitouchManager.swiftwith aLog.warningwhen the event tap cannot be created.