Logs sideloading-related events with OSLog

This commit is contained in:
Riley Testut
2023-10-18 14:06:10 -05:00
committed by Magesh K
parent 6adf55b4b6
commit 93b6da4855
13 changed files with 161 additions and 22 deletions

View File

@@ -0,0 +1,33 @@
//
// Logger+AltStore.swift
// AltStoreCore
//
// Created by Riley Testut on 10/2/23.
// Copyright © 2023 Riley Testut. All rights reserved.
//
@_exported import OSLog
public extension Logger
{
static let altstoreSubsystem = Bundle.main.bundleIdentifier!
static let sideload = Logger(subsystem: altstoreSubsystem, category: "Sideload")
}
@available(iOS 15, *)
public extension OSLogEntryLog.Level
{
var localizedName: String {
switch self
{
case .undefined: return NSLocalizedString("Undefined", comment: "")
case .debug: return NSLocalizedString("Debug", comment: "")
case .info: return NSLocalizedString("Info", comment: "")
case .notice: return NSLocalizedString("Notice", comment: "")
case .error: return NSLocalizedString("Error", comment: "")
case .fault: return NSLocalizedString("Fault", comment: "")
@unknown default: return NSLocalizedString("Unknown", comment: "")
}
}
}