-
Notifications
You must be signed in to change notification settings - Fork 134
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
✨ [RUMF-530][Logs] allow using logs API before init #545
✨ [RUMF-530][Logs] allow using logs API before init #545
Conversation
Tests will be moved in a separate commit to ease the review
Codecov Report
@@ Coverage Diff @@
## master #545 +/- ##
==========================================
+ Coverage 88.11% 89.66% +1.55%
==========================================
Files 36 38 +2
Lines 2288 2265 -23
Branches 469 473 +4
==========================================
+ Hits 2016 2031 +15
+ Misses 272 234 -38
Continue to review full report at Codecov.
|
This reverts commit 7d6d545.
…ll-before-init-logs
for dependency injection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job 👍
@@ -5,7 +5,6 @@ import { includes, ONE_KILO_BYTE, ONE_SECOND } from './utils' | |||
|
|||
export const DEFAULT_CONFIGURATION = { | |||
allowedTracingOrigins: [] as Array<string | RegExp>, | |||
isCollectingError: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just letting you know this is a breaking change but wasn't reported as such in your changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @tbillington, it should not be.
There was an issue in the logs documentation, isCollectingError
was not an init parameter for logs, forwardErrorToLogs
was the right one: https://github.com/DataDog/browser-sdk/pull/545/files#diff-2e4bca1144de53c8c504edb040ac34aa7ea63ba413a4453277d88307278d8972R43.
It is still collecting error by default: https://github.com/DataDog/browser-sdk/pull/545/files#diff-c62c675364c11388aeae30517afdac97f57f2638e8fb3d019177ebfeb382f540R25
If you still see something wrong, would you mind opening a dedicated issue and provide more details?
Motivation
We want to allow using log APIs before initialising the SDK.
Changes
Testing
Unit tests have been updated. Manual testing can be done by running some
DD_LOGS.logger.log('foo')
beforeDD_LOGS.init()
.I have gone over the contributing documentation.