CrashReporter
CrashReporter copied to clipboard
Integrate PLCrashReporter's text formatter for new crash logs
Modern macOS formats crash reports differently than it used to. PLCrashReporter comes with a formatter that could help provide us with readable crash logs.
The rest of the PLCrashReporter
source is less relevant, but the formatter types can be cherry picked. For inspiration, see NetNewsWire: https://github.com/Ranchero-Software/NetNewsWire/commit/3022f78434bf7f8e57f879edf6de4e6431357a2e
guard crashReporter.hasPendingCrashReport(),
let crashData = crashReporter.loadPendingCrashReportData(),
let crashReport = try? PLCrashReport(data: crashData),
let crashLogText = PLCrashReportTextFormatter.stringValue(for: crashReport, with: PLCrashReportTextFormatiOS)
else { return }
This would replace the .crash
file lookup part and extraction of the string contents:
- The call to send(...) will be affected, and
-
CrashInfo
would wrap thePLCrashReport
and expose its content string viaPLCrashReportTextFormatter