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: Ranchero-Software/NetNewsWire@3022f78
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 the PLCrashReport and expose its content string via PLCrashReportTextFormatter
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
PLCrashReportersource is less relevant, but the formatter types can be cherry picked. For inspiration, see NetNewsWire: Ranchero-Software/NetNewsWire@3022f78This would replace the
.crashfile lookup part and extraction of the string contents:CrashInfowould wrap thePLCrashReportand expose its content string viaPLCrashReportTextFormatter