feat(browser): Add console logging integration #15828
Closed
+351
−78
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.
ref #15526
Adds
consoleLoggingIntegration
integration that takes calls toconsole.X
and flushes them as logs. See below about why this is a new integration.I made this a separate integration because calls we needed to access the capturing methods through the browser SDK, which causes the SDK to start it's flushing mechanisms.
Notes
In general we have inconsistencies with console instrumentation across our different SDKs. #4532.
Breadcrumbs
integration.Console
integrationCaptureConsole
integrationThis makes it hard for me to tell where to add the logging instrumentation for consoles. I found the easiest way around this was to add brand new logging integrations, separate from breadcrumbs and errors functionality.
After this PR gets merged in, I'll take a look at doing the same for Node.js.