-
Notifications
You must be signed in to change notification settings - Fork 1
Sentry #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry #4
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
|
@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 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.