mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 13:55:58 +00:00
Logs instead of prints
This commit is contained in:
1 parent
6e33998fb6
commit
ca722b8894
7 files changed
+16
-18
No files matched your search
@@ -12,7 +12,7 @@ class AudioManager {
|
|||||||
|
|
||||||
static func playSound() {
|
static func playSound() {
|
||||||
guard let soundURL = Bundle.main.url(forResource: "timeIsNow", withExtension: "mp3") else {
|
guard let soundURL = Bundle.main.url(forResource: "timeIsNow", withExtension: "mp3") else {
|
||||||
print("Sound file not found")
|
log("Sound file not found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class AudioManager {
|
|||||||
audioPlayer = try AVAudioPlayer(contentsOf: soundURL)
|
audioPlayer = try AVAudioPlayer(contentsOf: soundURL)
|
||||||
audioPlayer?.play()
|
audioPlayer?.play()
|
||||||
} catch {
|
} catch {
|
||||||
print("Error playing sound: \(error.localizedDescription)")
|
log("Error playing sound: \(error.localizedDescription)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ func getActiveNetworkInterface() -> String? {
|
|||||||
do {
|
do {
|
||||||
try process.run()
|
try process.run()
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to run process: \(error)")
|
log("Failed to run process: \(error)")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class IPv6DeviceScanner {
|
|||||||
do {
|
do {
|
||||||
try process.run()
|
try process.run()
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to run ping6: \(error)")
|
log("Failed to run ping6: \(error)")
|
||||||
completion([])
|
completion([])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ struct SettingsView: View {
|
|||||||
let url = try URL(resolvingBookmarkData: saveFolderPath, options: [], relativeTo: nil, bookmarkDataIsStale: &isStale)
|
let url = try URL(resolvingBookmarkData: saveFolderPath, options: [], relativeTo: nil, bookmarkDataIsStale: &isStale)
|
||||||
return url.lastPathComponent // Returns the folder path as a string
|
return url.lastPathComponent // Returns the folder path as a string
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to resolve bookmark: \(error)")
|
log("Failed to resolve bookmark: \(error)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil // No saved folder
|
return nil // No saved folder
|
||||||
@@ -63,15 +63,13 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
if panel.runModal() == .OK, let url = panel.urls.first {
|
if panel.runModal() == .OK, let url = panel.urls.first {
|
||||||
do {
|
do {
|
||||||
print("Selected folder: \(url)")
|
log("Selected folder: \(url)")
|
||||||
|
|
||||||
let bookmarkData = try url.bookmarkData(options: .withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil)
|
let bookmarkData = try url.bookmarkData(options: .withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil)
|
||||||
|
|
||||||
print(bookmarkData)
|
|
||||||
|
|
||||||
UserDefaults.standard.set(bookmarkData, forKey: UserDefaultsKeys.saveFolderBookmark.rawValue)
|
UserDefaults.standard.set(bookmarkData, forKey: UserDefaultsKeys.saveFolderBookmark.rawValue)
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to save security-scoped bookmark: \(error)")
|
log("Failed to save security-scoped bookmark: \(error)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,12 +110,12 @@ struct LargeAppIconView<Content: View>: View {
|
|||||||
.padding(.top, 50)
|
.padding(.top, 50)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
taps += 1
|
taps += 1
|
||||||
print("Clicked \(taps) times")
|
log("Clicked \(taps) times")
|
||||||
|
|
||||||
if taps == 5 {
|
if taps == 5 {
|
||||||
|
|
||||||
sendLoggingString()
|
sendLoggingString()
|
||||||
print("Copied log to clipboard")
|
log("Copied log to clipboard")
|
||||||
|
|
||||||
taps = 0
|
taps = 0
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ func sendLoggingString() {
|
|||||||
|
|
||||||
func sendEmailWithAttachment(fileURL: URL, recipients: [String], subject: String) {
|
func sendEmailWithAttachment(fileURL: URL, recipients: [String], subject: String) {
|
||||||
guard let emailService = NSSharingService(named: .composeEmail) else {
|
guard let emailService = NSSharingService(named: .composeEmail) else {
|
||||||
print("No email service available")
|
log("No email service available")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -533,11 +533,11 @@ public class SaveFilesManager {
|
|||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print("Bookmark is stale, using default downloads folder.")
|
log("Bookmark is stale, using default downloads folder.")
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to resolve bookmark: \(error), using default downloads folder.")
|
log("Failed to resolve bookmark: \(error), using default downloads folder.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -707,7 +707,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
|
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
||||||
@@ -739,7 +739,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
|
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
||||||
@@ -899,7 +899,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = NearDrop/NearDrop.entitlements;
|
CODE_SIGN_ENTITLEMENTS = NearDrop/NearDrop.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
||||||
@@ -938,7 +938,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = NearDrop/NearDrop.entitlements;
|
CODE_SIGN_ENTITLEMENTS = NearDrop/NearDrop.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
CURRENT_PROJECT_VERSION = "${SHARED_BUILD}";
|
||||||
|
|||||||
Reference in new issue
Block a user