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

[PLAT-4174] Add [Bugsnag] prefix to log messages #955

Merged
merged 3 commits into from
Dec 23, 2020

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Dec 23, 2020

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.h

Code inside KSCrash continues to use the BSG_KSLOG_* macros (there are > 200 usages) but they now redirect to bsg_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.

@nickdowell nickdowell merged commit a3357c5 into next Dec 23, 2020
@nickdowell nickdowell deleted the nickdowell/logging-prefix branch December 23, 2020 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants