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
@@ -53,7 +53,7 @@ class BugReportService: BugReportServiceProtocol {
}
options.onCrashedLastRun = { [weak self] event in
MXLog.debug("Sentry detected application was crashed: \(event)")
MXLog.error("Sentry detected application was crashed: \(event)")
self?.lastCrashEventId = event.eventId.sentryIdString
}
}
@@ -79,11 +79,7 @@ class BugReportService: BugReportServiceProtocol {
includeCrashLog: Bool,
githubLabels: [String],
files: [URL]) async throws -> SubmitBugReportResponse {
MXLog.debug("submitBugReport")
var params = [
MultipartFormData(key: "text", type: .text(value: text))
]
var params = [MultipartFormData(key: "text", type: .text(value: text))]
params.append(contentsOf: defaultParams)
for label in githubLabels {
params.append(MultipartFormData(key: "label", type: .text(value: label)))
@@ -140,6 +136,8 @@ class BugReportService: BugReportServiceProtocol {
lastCrashEventId = nil
}
MXLog.info("Feedback submitted.")
return result
}
@@ -176,7 +174,7 @@ class BugReportService: BugReportServiceProtocol {
private func zipFiles(includeLogs: Bool,
includeCrashLog: Bool) async throws -> [URL] {
MXLog.debug("zipFiles: includeLogs: \(includeLogs), includeCrashLog: \(includeCrashLog)")
MXLog.info("zipFiles: includeLogs: \(includeLogs), includeCrashLog: \(includeCrashLog)")
var filesToCompress: [URL] = []
if includeLogs {
@@ -213,7 +211,7 @@ class BugReportService: BugReportServiceProtocol {
zippedFiles.append(zippedFileURL)
}
MXLog.debug("zipFiles: totalSize: \(totalSize), totalZippedSize: \(totalZippedSize)")
MXLog.info("zipFiles: totalSize: \(totalSize), totalZippedSize: \(totalZippedSize)")
return zippedFiles
}