Formats full crash reports with extra diagnostic information #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
This formatter will generate a valid Apple crash report version 104 using the extended diagnostic information generated by our diagnostics filter.
+9000 lines correspond to a crash reports used in unit tests. Another ~200 to Xcode related project files such as schemes, hopefully knowing this makes the PR less scary.
RollbarCrashFormattingFilter
class is our hook intoKSCrash
report post-crash processing that happens the next time the app is opened after a crash occurred, and before sending the report to Rollbar.The formatting occurs after the
RollbarCrashDiagnosticFilter
is done extracting all the extra diagnostic information we use.The entry point is the
filterReports
function. We receive an array of reports, each report is a hashmap (aDictionary
in Apple parlance), that we validate for correctness and then format by producing by making use of an internal micro-DSL that helps us format the report with which must simplicity, we then send back the report as anNSString
to theKSCrash
processing pipeline, where we eventually receive it and send it to Rollbar.Diagnostic/RollbarCrashFormattingFilter.swift would be a good place to start a review.
The formatter uses a mini-DSL created for the purpose of building complex multiline strings in a simple, straightforward way, the DSL is defined in
FormatBuilder.swift
.Files in the
Report
dir correspond to the data structures in the json report. Not all objects in the json structure have a defined data struct.Type of change
Related issues
Checklists
Development
Code review