mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-15 17:53:31 +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
|
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)
|
try FileManager.default.removeItem(at: fileURL)
|
||||||
}
|
}
|
||||||
catch
|
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)
|
errors.append(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,13 +174,13 @@ private extension ClearAppCacheOperation
|
|||||||
|
|
||||||
if isDirectory && !installedAppBundleIDs.contains(bundleID) && !AppManager.shared.isActivelyManagingApp(withBundleID: bundleID)
|
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)
|
try FileManager.default.removeItem(at: backupDirectory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
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)
|
errors.append(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ private extension ClearAppCacheOperation
|
|||||||
}
|
}
|
||||||
catch
|
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))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,10 +87,11 @@ final class UpdatePatronsOperation: ResultOperation<Void>
|
|||||||
|
|
||||||
self.finish(.success(()))
|
self.finish(.success(()))
|
||||||
|
|
||||||
print("Updated Friend Zone Patrons!")
|
Logger.main.notice("Updated Friend Zone Patrons! Refresh ID: \(response.refreshID, privacy: .public)")
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Logger.main.error("Failed to update Friend Zone Patrons. \(error.localizedDescription, privacy: .public)")
|
||||||
self.finish(.failure(error))
|
self.finish(.failure(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public extension Logger
|
|||||||
{
|
{
|
||||||
static let altstoreSubsystem = Bundle.main.bundleIdentifier!
|
static let altstoreSubsystem = Bundle.main.bundleIdentifier!
|
||||||
|
|
||||||
|
static let main = Logger(subsystem: altstoreSubsystem, category: "Main")
|
||||||
static let sideload = Logger(subsystem: altstoreSubsystem, category: "Sideload")
|
static let sideload = Logger(subsystem: altstoreSubsystem, category: "Sideload")
|
||||||
static let altjit = Logger(subsystem: altstoreSubsystem, category: "AltJIT")
|
static let altjit = Logger(subsystem: altstoreSubsystem, category: "AltJIT")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user