From 27ca2f285b53d31423331224be3819d660ab8b73 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 18 Oct 2023 14:09:06 -0500 Subject: [PATCH] Logs Fugu14-related events with OSLog --- AltStore/Operations/Patch App/PatchAppOperation.swift | 6 +++--- AltStore/Operations/Patch App/PatchViewController.swift | 6 +++--- AltStoreCore/Extensions/Logger+AltStore.swift | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/AltStore/Operations/Patch App/PatchAppOperation.swift b/AltStore/Operations/Patch App/PatchAppOperation.swift index 9397cacb..fd93134b 100644 --- a/AltStore/Operations/Patch App/PatchAppOperation.swift +++ b/AltStore/Operations/Patch App/PatchAppOperation.swift @@ -197,7 +197,7 @@ private extension PatchAppOperation } } - print("Downloaded OTA archive.") + Logger.fugu14.notice("Downloaded iOS OTA archive.") return archiveURL #endif @@ -227,7 +227,7 @@ private extension PatchAppOperation return .ok } - print("Extracted Spotlight from OTA archive.") + Logger.fugu14.notice("Extracted Spotlight from OTA archive.") return spotlightFileURL #endif @@ -249,7 +249,7 @@ private extension PatchAppOperation let appBinaryURL = temporaryAppURL.appendingPathComponent(appName, isDirectory: false) try self.appPatcher.patchAppBinary(at: appBinaryURL, withBinaryAt: patchFileURL) - print("Patched \(app.name).") + Logger.fugu14.notice("Patched \(app.name, privacy: .public)!") return temporaryAppURL } .mapError { ($0 as NSError).withLocalizedFailure(String(format: NSLocalizedString("Could not patch %@ placeholder.", comment: ""), app.name)) } diff --git a/AltStore/Operations/Patch App/PatchViewController.swift b/AltStore/Operations/Patch App/PatchViewController.swift index 14d79c8d..7ce56d24 100644 --- a/AltStore/Operations/Patch App/PatchViewController.swift +++ b/AltStore/Operations/Patch App/PatchViewController.swift @@ -81,7 +81,7 @@ final class PatchViewController: UIViewController } catch { - print("Failed to create temporary directory:", error) + Logger.fugu14.error("Failed to create temporary directory \(self.temporaryDirectory.lastPathComponent, privacy: .public). \(error.localizedDescription, privacy: .public)") } self.update() @@ -197,7 +197,7 @@ private extension PatchViewController } catch { - print("Failed to remove temporary directory:", error) + Logger.fugu14.error("Failed to remove temporary directory \(self.temporaryDirectory.lastPathComponent, privacy: .public). \(error.localizedDescription, privacy: .public)") } if let observation = self.didEnterBackgroundObservation @@ -313,7 +313,7 @@ private extension PatchViewController } catch { - print("Error unzipping app bundle:", error) + Logger.fugu14.error("Error unzipping app bundle: \(error.localizedDescription, privacy: .public)") unzippingError = error } } diff --git a/AltStoreCore/Extensions/Logger+AltStore.swift b/AltStoreCore/Extensions/Logger+AltStore.swift index 41d604ad..a6998c35 100644 --- a/AltStoreCore/Extensions/Logger+AltStore.swift +++ b/AltStoreCore/Extensions/Logger+AltStore.swift @@ -13,6 +13,8 @@ public extension Logger static let altstoreSubsystem = Bundle.main.bundleIdentifier! static let sideload = Logger(subsystem: altstoreSubsystem, category: "Sideload") + + static let fugu14 = Logger(subsystem: altstoreSubsystem, category: "Fugu14") } @available(iOS 15, *)