mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-18 12:31:01 +01:00
Merge pull request #2624 from Wevah/logging-audit
Replace the single usage of a Log object with os_log()
This commit is contained in:
commit
3335c39c55
@ -15,6 +15,7 @@ import Account
|
|||||||
import RSCore
|
import RSCore
|
||||||
import RSCoreResources
|
import RSCoreResources
|
||||||
import Secrets
|
import Secrets
|
||||||
|
import OSLog
|
||||||
|
|
||||||
// If we're not going to import Sparkle, provide dummy protocols to make it easy
|
// If we're not going to import Sparkle, provide dummy protocols to make it easy
|
||||||
// for AppDelegate to comply
|
// for AppDelegate to comply
|
||||||
@ -97,7 +98,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
private var keyboardShortcutsWindowController: WebViewWindowController?
|
private var keyboardShortcutsWindowController: WebViewWindowController?
|
||||||
private var inspectorWindowController: InspectorWindowController?
|
private var inspectorWindowController: InspectorWindowController?
|
||||||
private var crashReportWindowController: CrashReportWindowController? // For testing only
|
private var crashReportWindowController: CrashReportWindowController? // For testing only
|
||||||
private let log = Log()
|
|
||||||
private let appMovementMonitor = RSAppMovementMonitor()
|
private let appMovementMonitor = RSAppMovementMonitor()
|
||||||
#if !MAC_APP_STORE && !TEST
|
#if !MAC_APP_STORE && !TEST
|
||||||
private var softwareUpdater: SPUUpdater!
|
private var softwareUpdater: SPUUpdater!
|
||||||
@ -119,22 +119,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - API
|
// MARK: - API
|
||||||
func logMessage(_ message: String, type: LogItem.ItemType) {
|
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
if type == .debug {
|
|
||||||
print("logMessage: \(message) - \(type)")
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
let logItem = LogItem(type: type, message: message)
|
|
||||||
log.add(logItem)
|
|
||||||
}
|
|
||||||
|
|
||||||
func logDebugMessage(_ message: String) {
|
|
||||||
logMessage(message, type: .debug)
|
|
||||||
}
|
|
||||||
|
|
||||||
func showAddFolderSheetOnWindow(_ window: NSWindow) {
|
func showAddFolderSheetOnWindow(_ window: NSWindow) {
|
||||||
addFolderWindowController = AddFolderWindowController()
|
addFolderWindowController = AddFolderWindowController()
|
||||||
addFolderWindowController!.runSheetOnWindow(window)
|
addFolderWindowController!.runSheetOnWindow(window)
|
||||||
@ -199,7 +183,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
AppDefaults.shared.registerDefaults()
|
AppDefaults.shared.registerDefaults()
|
||||||
let isFirstRun = AppDefaults.shared.isFirstRun
|
let isFirstRun = AppDefaults.shared.isFirstRun
|
||||||
if isFirstRun {
|
if isFirstRun {
|
||||||
logDebugMessage("Is first run.")
|
os_log(.debug, "Is first run.")
|
||||||
}
|
}
|
||||||
let localAccount = AccountManager.shared.defaultAccount
|
let localAccount = AccountManager.shared.defaultAccount
|
||||||
|
|
||||||
|
@ -179,15 +179,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func logMessage(_ message: String, type: LogItem.ItemType) {
|
|
||||||
print("logMessage: \(message) - \(type)")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func logDebugMessage(_ message: String) {
|
|
||||||
logMessage(message, type: .debug)
|
|
||||||
}
|
|
||||||
|
|
||||||
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
||||||
completionHandler([.banner, .badge, .sound])
|
completionHandler([.banner, .badge, .sound])
|
||||||
}
|
}
|
||||||
|
@ -189,15 +189,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func logMessage(_ message: String, type: LogItem.ItemType) {
|
|
||||||
print("logMessage: \(message) - \(type)")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func logDebugMessage(_ message: String) {
|
|
||||||
logMessage(message, type: .debug)
|
|
||||||
}
|
|
||||||
|
|
||||||
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
||||||
completionHandler([.alert, .badge, .sound])
|
completionHandler([.alert, .badge, .sound])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user