newrelic / newrelic-browser-agent

New Relic Browser Agent
Apache License 2.0
77 stars 40 forks source link

feat: Add wrapLogger API method for wrapping 3rd party loggers #1054

Closed metal-messiah closed 4 months ago

metal-messiah commented 4 months ago

Observe existing logging functions and report through event emitter for later processing when capturing log events.

Overview

NOTE please review #1052 first, as this PR is branched from that.

Related Issue(s)

NR-251149

Testing

New jest tests have been added

github-actions[bot] commented 4 months ago

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 31.78 kB / 11.13 kB (gzip) 33.54 kB / 11.73 kB (gzip) 5.53% / 5.35% (gzip)
lite async-chunk 50.97 kB / 16.57 kB (gzip) 49.88 kB / 16.12 kB (gzip) -2.14% / -2.69% (gzip)
pro loader 53.05 kB / 17.97 kB (gzip) 53.73 kB / 18.19 kB (gzip) 1.28% / 1.24% (gzip)
pro async-chunk 93.81 kB / 28.31 kB (gzip) 93.81 kB / 28.31 kB (gzip) 0% / 0% (gzip)
spa loader 61.16 kB / 20.48 kB (gzip) 61.88 kB / 20.69 kB (gzip) 1.18% / 1.01% (gzip)
spa async-chunk 109.07 kB / 32.74 kB (gzip) 109.07 kB / 32.74 kB (gzip) 0% / -0.01% (gzip)
lite-polyfills loader 125.76 kB / 40.42 kB (gzip) 128.23 kB / 41.08 kB (gzip) 1.97% / 1.64% (gzip)
lite-polyfills async-chunk 65.71 kB / 18.91 kB (gzip) 64.61 kB / 18.46 kB (gzip) -1.67% / -2.36% (gzip)
pro-polyfills loader 147.47 kB / 46.69 kB (gzip) 148.86 kB / 46.96 kB (gzip) 0.94% / 0.57% (gzip)
pro-polyfills async-chunk 114.33 kB / 30.27 kB (gzip) 114.33 kB / 30.27 kB (gzip) 0% / -0.01% (gzip)
spa-polyfills loader 155.67 kB / 48.83 kB (gzip) 157.11 kB / 49.1 kB (gzip) 0.93% / 0.56% (gzip)
spa-polyfills async-chunk 131.33 kB / 34.9 kB (gzip) 131.33 kB / 34.9 kB (gzip) 0% / 0% (gzip)
codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 80.76923% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 87.51%. Comparing base (face445) to head (f60deac).

Files Patch % Lines
src/loaders/api/api.js 77.77% 4 Missing :warning:
src/common/wrap/wrap-logger.js 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1054 +/- ## ========================================== - Coverage 87.54% 87.51% -0.04% ========================================== Files 156 157 +1 Lines 7120 7150 +30 Branches 1398 1404 +6 ========================================== + Hits 6233 6257 +24 - Misses 772 778 +6 Partials 115 115 ``` | [Flag](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1054/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | Coverage Δ | | |---|---|---| | [integration-tests](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1054/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `91.03% <12.50%> (-0.30%)` | :arrow_down: | | [unit-tests](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1054/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `76.29% <100.00%> (+0.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 4 months ago

Static Badge

Last ran on June 03, 2024 12:48:35 CDT Checking merge of (f60deac43b78d0791fa2ac4021b88e80da800c17) into main (face4457f2ec29699b610cb096864ee3a16aafdc)