Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DivineDominion opened this issue Oct 26, 2023 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@DivineDominion
Copy link
Collaborator

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
@DivineDominion DivineDominion added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant