[RUM-6160] Added errorSource property in LogEvent for mapping #727
+225
−21
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.
What does this PR do?
Adds Error Source property to Log Events, so that it can be used in custom Log Event Mappers.
Example
To be discussed
This PR adds an extra parameter
source
to the public APIDdLogs.error()
:message
: stringerrorKind?
: stringerrorMessage?
: stringstacktrace?
: stringcontext?
: objectfingerprint?
: stringsource?
: ErrorSourceAnother option would be to add a custom Datadog attribute to the context and parse it internally (perhaps removing it before making the native call.
Finally, another option would be to refactor the implementation to hide the parameter from the public API.
Please let me know what you think about this.
Context
Currently, when
trackErrors
is set to true, we attach our error-reporting logic to:Console Errors (via
console.error
)React Native Global Error Handler (via
ErrorUtils.setGlobalHandler
)In some cases, users might not want to report console errors, and we currently don’t have a way to disable this behaviour.
Review checklist (to be filled by reviewers)