mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Logging changes
- Adds `Logging` protocol - Moves to Swift-style `OSLog` usage os_log to Logger os_log audit Replacment of os.log with Logging
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import RSCore
|
||||
|
||||
struct ArticleThemeImporter {
|
||||
struct ArticleThemeImporter: Logging {
|
||||
|
||||
static func importTheme(controller: UIViewController, filename: String) throws {
|
||||
let theme = try ArticleTheme(path: filename, isAppTheme: false)
|
||||
@@ -39,6 +40,7 @@ struct ArticleThemeImporter {
|
||||
confirmImportSuccess(controller: controller, themeName: theme.name)
|
||||
} catch {
|
||||
controller.presentError(error)
|
||||
ArticleThemeImporter.logger.error("Error importing theme: \(error.localizedDescription, privacy: .public)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
import Foundation
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
import RSCore
|
||||
import UIKit
|
||||
|
||||
class ArticleThemesTableViewController: UITableViewController {
|
||||
class ArticleThemesTableViewController: UITableViewController, Logging {
|
||||
|
||||
override func viewDidLoad() {
|
||||
let importBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(importTheme(_:)));
|
||||
@@ -118,6 +118,7 @@ extension ArticleThemesTableViewController: UIDocumentPickerDelegate {
|
||||
try ArticleThemeImporter.importTheme(controller: self, filename: url.standardizedFileURL.path)
|
||||
} catch {
|
||||
NotificationCenter.default.post(name: .didFailToImportThemeWithError, object: nil, userInfo: ["error": error])
|
||||
logger.error("Did fail to import theme: \(error.localizedDescription, privacy: .public)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,9 @@ import SafariServices
|
||||
import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
import UserNotifications
|
||||
import RSCore
|
||||
|
||||
class SettingsViewController: UITableViewController {
|
||||
class SettingsViewController: UITableViewController, Logging {
|
||||
|
||||
private weak var opmlAccount: Account?
|
||||
|
||||
@@ -509,6 +510,7 @@ private extension SettingsViewController {
|
||||
try opmlString.write(to: tempFile, atomically: true, encoding: String.Encoding.utf8)
|
||||
} catch {
|
||||
self.presentError(title: "OPML Export Error", message: error.localizedDescription)
|
||||
logger.error("OPML Export Error: \(error.localizedDescription, privacy: .public)")
|
||||
}
|
||||
|
||||
let docPicker = UIDocumentPickerViewController(forExporting: [tempFile], asCopy: true)
|
||||
|
||||
Reference in New Issue
Block a user