More logging

This commit is contained in:
Shadowfacts 2022-09-07 22:57:48 -04:00
parent 307299dd4d
commit ff9286ca48
2 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,7 @@ class BackgroundManager: NSObject {
do { do {
try await fervorController.persistentContainer.upsertItems(items) try await fervorController.persistentContainer.upsertItems(items)
logger.info("Upserted \(items.count) items during background refresh") logger.info("Upserted \(items.count) items during background refresh")
logger.info("Most recent unread item: \(items.first(where: { $0.read == false })!.title!, privacy: .public)")
await WidgetHelper.updateWidgetData(fervorController: fervorController) await WidgetHelper.updateWidgetData(fervorController: fervorController)

View File

@ -51,6 +51,8 @@ struct WidgetHelper {
} }
} }
logger.info("Saving widget data with first item: '\(prioritizedItems.first!.title ?? "<untitled>", privacy: .public)'")
WidgetData(recentItems: prioritizedItems).save(account: fervorController.account!) WidgetData(recentItems: prioritizedItems).save(account: fervorController.account!)
WidgetCenter.shared.reloadAllTimelines() WidgetCenter.shared.reloadAllTimelines()