mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Logs misc. events with OSLog
* Discovering AltServers * Clearing app cache * Updating Friend Zone Patrons
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,10 +87,11 @@ final class UpdatePatronsOperation: ResultOperation<Void>
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user