mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-12 00:03:27 +01:00
Anisette URL convenience methods and logging
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
This commit is contained in:
65
AltStore/Extensions/OSLog+SideStore.swift
Normal file
65
AltStore/Extensions/OSLog+SideStore.swift
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// OSLog+SideStore.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Joseph Mattiello on 11/16/22.
|
||||
// Copyright © 2022 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OSLog
|
||||
|
||||
let customLog = OSLog(subsystem: "org.sidestore.sidestore",
|
||||
category: "ios")
|
||||
|
||||
|
||||
public extension OSLog {
|
||||
/// Error logger extension
|
||||
/// - Parameters:
|
||||
/// - message: String or format string
|
||||
/// - args: optional args for format string
|
||||
static func error(_ message: StaticString, _ args: CVarArg...) {
|
||||
os_log(message, log: customLog, type: .error, args)
|
||||
}
|
||||
|
||||
/// Info logger extension
|
||||
/// - Parameters:
|
||||
/// - message: String or format string
|
||||
/// - args: optional args for format string
|
||||
static func info(_ message: StaticString, _ args: CVarArg...) {
|
||||
os_log(message, log: customLog, type: .info, args)
|
||||
}
|
||||
|
||||
/// Debug logger extension
|
||||
/// - Parameters:
|
||||
/// - message: String or format string
|
||||
/// - args: optional args for format string
|
||||
static func debug(_ message: StaticString, _ args: CVarArg...) {
|
||||
os_log(message, log: customLog, type: .debug, args)
|
||||
}
|
||||
}
|
||||
|
||||
/// Error logger convenience method for SideStore logging
|
||||
/// - Parameters:
|
||||
/// - message: String or format string
|
||||
/// - args: optional args for format string
|
||||
public func ELOG(_ message: StaticString, _ args: CVarArg...) {
|
||||
OSLog.error(message, args)
|
||||
}
|
||||
|
||||
/// Info logger convenience method for SideStore logging
|
||||
/// - Parameters:
|
||||
/// - message: String or format string
|
||||
/// - args: optional args for format string
|
||||
public func ILOG(_ message: StaticString, _ args: CVarArg...) {
|
||||
OSLog.info(message, args)
|
||||
}
|
||||
|
||||
|
||||
/// Debug logger convenience method for SideStore logging
|
||||
/// - Parameters:
|
||||
/// - message: String or format string
|
||||
/// - args: optional args for format string
|
||||
public func DLOG(_ message: StaticString, _ args: CVarArg...) {
|
||||
OSLog.debug(message, args)
|
||||
}
|
||||
Reference in New Issue
Block a user