mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 19:11:10 +00:00
Improve logging
This commit is contained in:
1 parent
0df17c1bc7
commit
4c95be694f
5 files changed
+23
-12
No files matched your search
@@ -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
|
||||
|
||||
@@ -7157,6 +7157,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Reset UD" : {
|
||||
|
||||
},
|
||||
"SaveFilesLocation" : {
|
||||
"extractionState" : "manual",
|
||||
|
||||
@@ -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())"
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user