mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -58,7 +58,7 @@ class UIKitBackgroundTask: BackgroundTaskProtocol {
|
||||
}
|
||||
|
||||
if identifier == .invalid {
|
||||
MXLog.verbose("Do not start background task: \(name), as OS declined")
|
||||
MXLog.info("Do not start background task: \(name), as OS declined")
|
||||
// call expiration handler immediately
|
||||
expirationHandler?(self)
|
||||
return nil
|
||||
@@ -69,7 +69,7 @@ class UIKitBackgroundTask: BackgroundTaskProtocol {
|
||||
reuse()
|
||||
}
|
||||
|
||||
MXLog.verbose("Start background task #\(identifier.rawValue) - \(name)")
|
||||
MXLog.info("Start background task #\(identifier.rawValue) - \(name)")
|
||||
}
|
||||
|
||||
func reuse() {
|
||||
@@ -92,7 +92,7 @@ class UIKitBackgroundTask: BackgroundTaskProtocol {
|
||||
|
||||
private func endTask() {
|
||||
if identifier != .invalid {
|
||||
MXLog.verbose("End background task #\(identifier.rawValue) - \(name) after \(readableElapsedTime)")
|
||||
MXLog.info("End background task #\(identifier.rawValue) - \(name) after \(readableElapsedTime)")
|
||||
|
||||
application.endBackgroundTask(identifier)
|
||||
identifier = .invalid
|
||||
|
||||
@@ -36,12 +36,12 @@ class UIKitBackgroundTaskService: BackgroundTaskServiceProtocol {
|
||||
isReusable: Bool,
|
||||
expirationHandler: (() -> Void)?) -> BackgroundTaskProtocol? {
|
||||
guard let application else {
|
||||
MXLog.verbose("Do not start background task: \(name). Application is nil")
|
||||
MXLog.error("Do not start background task: \(name). Application is nil")
|
||||
return nil
|
||||
}
|
||||
|
||||
if avoidStartingNewTasks(for: application) {
|
||||
MXLog.verbose("Do not start background task: \(name), as not enough time exists")
|
||||
MXLog.info("Do not start background task: \(name), as not enough time exists")
|
||||
// call expiration handler immediately
|
||||
expirationHandler?()
|
||||
return nil
|
||||
@@ -82,7 +82,7 @@ class UIKitBackgroundTaskService: BackgroundTaskServiceProtocol {
|
||||
let appState = application.applicationState
|
||||
let remainingTime = readableBackgroundTimeRemaining(application.backgroundTimeRemaining)
|
||||
|
||||
MXLog.verbose("Background task \(name) \(created ? "started" : "reused") with app state: \(appState) and estimated background time remaining: \(remainingTime)")
|
||||
MXLog.info("Background task \(name) \(created ? "started" : "reused") with app state: \(appState) and estimated background time remaining: \(remainingTime)")
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user