diff --git a/AltStore/Operations/ClearAppCacheOperation.swift b/AltStore/Operations/ClearAppCacheOperation.swift index b7867225..b6a36afb 100644 --- a/AltStore/Operations/ClearAppCacheOperation.swift +++ b/AltStore/Operations/ClearAppCacheOperation.swift @@ -109,12 +109,12 @@ private extension ClearAppCacheOperation { do { - print("[ALTLog] Removing item from temporary directory:", fileURL.lastPathComponent) + Logger.main.debug("Removing item from temporary directory: \(fileURL.lastPathComponent, privacy: .public)") try FileManager.default.removeItem(at: fileURL) } catch { - print("[ALTLog] Failed to remove \(fileURL.lastPathComponent) from temporary directory.", error) + Logger.main.error("Failed to remove \(fileURL.lastPathComponent) from temporary directory. \(error.localizedDescription, privacy: .public)") errors.append(error) } } @@ -174,13 +174,13 @@ private extension ClearAppCacheOperation if isDirectory && !installedAppBundleIDs.contains(bundleID) && !AppManager.shared.isActivelyManagingApp(withBundleID: bundleID) { - print("[ALTLog] Removing backup directory for uninstalled app:", bundleID) + Logger.main.debug("Removing backup directory for uninstalled app: \(bundleID, privacy: .public)") try FileManager.default.removeItem(at: backupDirectory) } } catch { - print("[ALTLog] Failed to remove app backup directory:", error) + Logger.main.error("Failed to remove app backup directory. \(error.localizedDescription, privacy: .public)") errors.append(error) } } @@ -198,7 +198,7 @@ private extension ClearAppCacheOperation } catch { - print("[ALTLog] Failed to remove app backup directory:", error) + Logger.main.error("Failed to remove app backup directory. \(error.localizedDescription, privacy: .public)") completion(.failure(error)) } } diff --git a/AltStore/Operations/UpdatePatronsOperation.swift b/AltStore/Operations/UpdatePatronsOperation.swift index c55f11de..6aa939e1 100644 --- a/AltStore/Operations/UpdatePatronsOperation.swift +++ b/AltStore/Operations/UpdatePatronsOperation.swift @@ -87,10 +87,11 @@ final class UpdatePatronsOperation: ResultOperation self.finish(.success(())) - print("Updated Friend Zone Patrons!") + Logger.main.notice("Updated Friend Zone Patrons! Refresh ID: \(response.refreshID, privacy: .public)") } catch { + Logger.main.error("Failed to update Friend Zone Patrons. \(error.localizedDescription, privacy: .public)") self.finish(.failure(error)) } } diff --git a/AltStoreCore/Extensions/Logger+AltStore.swift b/AltStoreCore/Extensions/Logger+AltStore.swift index e96c4850..4e02169a 100644 --- a/AltStoreCore/Extensions/Logger+AltStore.swift +++ b/AltStoreCore/Extensions/Logger+AltStore.swift @@ -12,6 +12,7 @@ public extension Logger { static let altstoreSubsystem = Bundle.main.bundleIdentifier! + static let main = Logger(subsystem: altstoreSubsystem, category: "Main") static let sideload = Logger(subsystem: altstoreSubsystem, category: "Sideload") static let altjit = Logger(subsystem: altstoreSubsystem, category: "AltJIT")