Improvements to logging (#457)

* Use `.info` logging in most places.
* Remove old objc logging support.
* Fix table view controller.
* Make sure timeline item content isn't logged.
* Add tests.
This commit is contained in:
Doug
2023-01-17 09:28:01 +00:00
committed by GitHub
parent 4b56e4af73
commit c8937505d7
57 changed files with 542 additions and 275 deletions
@@ -49,12 +49,12 @@ class NotificationManager: NSObject, NotificationManagerProtocol {
Task {
do {
let granted = try await notificationCenter.requestAuthorization(options: [.alert, .sound, .badge])
MXLog.debug("[NotificationManager] permission granted: \(granted)")
MXLog.info("[NotificationManager] permission granted: \(granted)")
await MainActor.run {
self.delegate?.authorizationStatusUpdated(self, granted: granted)
}
} catch {
MXLog.debug("[NotificationManager] request authorization failed: \(error)")
MXLog.error("[NotificationManager] request authorization failed: \(error)")
}
}
}
@@ -76,9 +76,9 @@ class NotificationManager: NSObject, NotificationManagerProtocol {
trigger: nil)
do {
try await notificationCenter.add(request)
MXLog.debug("[NotificationManager] show local notification succeeded")
MXLog.info("[NotificationManager] show local notification succeeded")
} catch {
MXLog.debug("[NotificationManager] show local notification failed: \(error)")
MXLog.error("[NotificationManager] show local notification failed: \(error)")
}
}
@@ -102,10 +102,10 @@ class NotificationManager: NSObject, NotificationManagerProtocol {
]
]
])
MXLog.debug("[NotificationManager] set pusher succeeded")
MXLog.info("[NotificationManager] set pusher succeeded")
return true
} catch {
MXLog.debug("[NotificationManager] set pusher failed: \(error)")
MXLog.error("[NotificationManager] set pusher failed: \(error)")
return false
}
}