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

ref: Use consistent console instrumentation #8879

Merged
merged 1 commit into from
Aug 29, 2023
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Aug 28, 2023

While looking into logger issues, I noticed that we fill console.xxx multiple times. This PR changes that so that we use the console instrumentation from utils in all cases.

@mydea mydea self-assigned this Aug 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.23 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.21 KB (+0.01% 🔺)
@sentry/browser - Webpack (gzipped) 21.86 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 69.78 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.22 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.19 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 220.09 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 84.92 KB (+0.04% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 59.89 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.13 KB (+0.09% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.25 KB (+0.02% 🔺)
@sentry/react - Webpack (gzipped) 21.89 KB (+0.05% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.05 KB (+0.02% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.76 KB (+0.06% 🔺)

@@ -29,51 +35,50 @@ export class CaptureConsole implements Integration {
/**
* @inheritDoc
*/
public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not change the signature of this. This integration is part of the public API.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be fine for an API as any caller can still pass in anything that you passed into it previously (it accepts more, not less), but I can leave it as is for sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's no reason to widen the API let's not do it.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if using a Proxy will help remove the fact that our current console instrumentation overrides the filename that is displayed in the console.

@mydea
Copy link
Member Author

mydea commented Aug 29, 2023

I wonder if using a Proxy will help remove the fact that our current console instrumentation overrides the filename that is displayed in the console.

I guess we can look at that for v8, maybe? Or have two implementations, but that is a bit bloaty 🤔

@mydea mydea merged commit ff0da3e into develop Aug 29, 2023
78 checks passed
@mydea mydea deleted the fn/use-console-instrument branch August 29, 2023 08:12
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.

3 participants