Improve logging

This commit is contained in:
Leon Böttger committed 2025-08-19 10:34:59 +02:00
1 parent 0df17c1bc7
commit 4c95be694f
5 files changed
+23 -12

No files matched your search

+3 -2
View File
@@ -112,6 +112,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
let queue2 = DispatchQueue(label: "NetworkConnectionMonitor")
hasConnectionMonitor.start(queue: queue2)
log("Application did finish launching")
}
@@ -147,10 +149,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
func application(_ application: NSApplication, open urls: [URL]) {
for url in urls {
if url.scheme == "quickdrop", url.host == "sendLog" {
sendLoggingString() // this time it runs in the main app
sendLoggingString()
}
if url.scheme == "quickdrop", url.host == "openLog", let url = LogManager.sharedInstance.logFileURL {
log("Opening log file: \(url)")
// open folder containing the log file
+3
View File
@@ -7157,6 +7157,9 @@
}
}
}
},
"Reset UD" : {
},
"SaveFilesLocation" : {
"extractionState" : "manual",
+8 -5
View File
@@ -148,12 +148,15 @@ func sendLoggingString() {
if let url = LogManager.sharedInstance.logFileURL {
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
log("Sending logging string with file URL: \(url)")
log("Currently running apps: \(NSWorkspace.shared.runningApplications.map { $0.localizedName ?? "Unknown" })")
sendEmailWithAttachment(
fileURL: url,
recipients: ["quickdrop@leonboettger.com"],
subject: "QuickDrop \(appVersion) - \(getDeviceAndSystem())"
)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
sendEmailWithAttachment(
fileURL: url,
recipients: ["quickdrop@leonboettger.com"],
subject: "QuickDrop \(appVersion) - \(getDeviceAndSystem())"
)
})
}
}