From 4931665b45b258eabf83d9007a98f6ef1d530d00 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 18 Apr 2023 10:10:15 -0400 Subject: [PATCH] Log Sentry installation ID So when the user taps Get Support and logs are sent we can cross-ref with recent crashes --- Tusker/AppDelegate.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tusker/AppDelegate.swift b/Tusker/AppDelegate.swift index aa64b5a8..1be6eff9 100644 --- a/Tusker/AppDelegate.swift +++ b/Tusker/AppDelegate.swift @@ -14,6 +14,7 @@ import UserAccounts import ComposeUI let stateRestorationLogger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "StateRestoration") +private let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "AppDelegate") @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -94,6 +95,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return Preferences.shared.reportErrorsAutomatically ? event : nil } } + + if let clazz = NSClassFromString("SentryInstallation"), + let objClazz = clazz as AnyObject as? NSObjectProtocol, + objClazz.responds(to: Selector(("id"))), + let id = objClazz.perform(Selector(("id"))).takeRetainedValue() as? String { + logger.info("Initialized Sentry with installation/user ID: \(id)") + } } override func buildMenu(with builder: UIMenuBuilder) {