Skip to content

Integrate PLCrashReporter's text formatter for new crash logs #5

@DivineDominion

Description

@DivineDominion

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:

  1. The call to send(...) will be affected, and
  2. CrashInfo would wrap the PLCrashReport and expose its content string via PLCrashReportTextFormatter

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions