mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 17:29:23 +00:00
Replace OSLog with Logger.
This commit is contained in:
1 parent
240f447386
commit
7ebfa05446
1 file changed
+11
-14
@@ -60,8 +60,8 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
private weak var initializedAccount: Account?
|
||||
|
||||
internal let caller: FeedlyAPICaller
|
||||
|
||||
private let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Feedly")
|
||||
|
||||
private static let logger = Feedly.logger
|
||||
private let database: SyncDatabase
|
||||
|
||||
private weak var currentSyncAllOperation: MainThreadOperation?
|
||||
@@ -112,21 +112,19 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
assert(Thread.isMainThread)
|
||||
|
||||
guard currentSyncAllOperation == nil else {
|
||||
os_log(.debug, log: log, "Ignoring refreshAll: Feedly sync already in progress.")
|
||||
Self.logger.debug("Feedly: Ignoring refreshAll: sync already in progress")
|
||||
completion(.success(()))
|
||||
return
|
||||
}
|
||||
|
||||
guard let credentials = credentials else {
|
||||
os_log(.debug, log: log, "Ignoring refreshAll: Feedly account has no credentials.")
|
||||
Self.logger.info("Feedly: Ignoring refreshAll: account has no credentials")
|
||||
completion(.failure(FeedlyAccountDelegateError.notLoggedIn))
|
||||
return
|
||||
}
|
||||
|
||||
refreshProgress.reset()
|
||||
|
||||
let log = self.log
|
||||
|
||||
let syncAllOperation = FeedlySyncAllOperation(account: account, feedlyUserId: credentials.username, caller: caller, database: database, lastSuccessfulFetchStartDate: accountMetadata?.lastArticleFetchStartTime, downloadProgress: refreshProgress)
|
||||
|
||||
syncAllOperation.downloadProgress = refreshProgress
|
||||
@@ -137,8 +135,8 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
self?.accountMetadata?.lastArticleFetchStartTime = date
|
||||
self?.accountMetadata?.lastArticleFetchEndTime = Date()
|
||||
}
|
||||
|
||||
os_log(.debug, log: log, "Sync took %{public}.3f seconds", -date.timeIntervalSinceNow)
|
||||
|
||||
Self.logger.debug("Feedly: Sync took \(-date.timeIntervalSinceNow, privacy: .public) seconds")
|
||||
completion(result)
|
||||
self?.refreshProgress.reset()
|
||||
}
|
||||
@@ -222,22 +220,22 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
completion(.failure(error))
|
||||
return
|
||||
}
|
||||
|
||||
os_log(.debug, log: log, "Begin importing OPML...")
|
||||
|
||||
Self.logger.info("Feedly: Begin importing OPML")
|
||||
isOPMLImportInProgress = true
|
||||
refreshProgress.addToNumberOfTasksAndRemaining(1)
|
||||
|
||||
caller.importOpml(data) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
os_log(.debug, log: self.log, "Import OPML done.")
|
||||
Self.logger.info("Feedly: OPML import finished")
|
||||
self.refreshProgress.completeTask()
|
||||
self.isOPMLImportInProgress = false
|
||||
DispatchQueue.main.async {
|
||||
completion(.success(()))
|
||||
}
|
||||
case .failure(let error):
|
||||
os_log(.debug, log: self.log, "Import OPML failed.")
|
||||
Self.logger.error("Feedly: OPML import failed: \(error.localizedDescription)")
|
||||
self.refreshProgress.completeTask()
|
||||
self.isOPMLImportInProgress = false
|
||||
DispatchQueue.main.async {
|
||||
@@ -495,10 +493,9 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
case .success:
|
||||
break
|
||||
case .failure(let error):
|
||||
os_log(.error, log: self.log, "Restore folder feed error: %@.", error.localizedDescription)
|
||||
Self.logger.error("Feedly: Restore folder feed error: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
group.notify(queue: .main) {
|
||||
|
||||
Reference in new issue
Block a user