[PLAT-4174] Add [Bugsnag] prefix to log messages #955
Merged
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.
Goal
Improves the consistency of and ability to search / filter Bugsnag log messages.
Improves the ability to diagnose E2E test failures by sending all possible message to NSLog so that they are captured in device logs by BrowserStack.
Changeset
The
bsg_log_
macros have been updated to include a prefix indicating the source (Bugsnag) and level, e.g.[Bugsnag] [WARN] Invalid apiKey: expected a 32-character hexademical string, got "YOUR-API-KEY"
[Bugsnag] [INFO] Sent session E8FE313F-042B-458F-97E6-067A52F86C23
[Bugsnag] [INFO] Sending 1 crash reports
Code outside the KSCrash subdirectory has been updated to use the
bsg_log_*
macros from BugsnagLogger.h - these should be used in preference to those declared in BSG_KSLogger.hCode inside KSCrash continues to use the
BSG_KSLOG_*
macros (there are > 200 usages) but they now redirect tobsg_log_*
when used in Objective-C code. This felt like a less disruptive / churny solution than replacing all uses of the old macro.Testing
Tested locally by running unit tests and example apps.