-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(utils): Convert Logger class to functions #4863
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
Conversation
94a679b
to
4d489e5
Compare
size-limit report 📦
|
* | ||
* @param callback The function to run against the original `console` messages | ||
* @returns The results of the callback | ||
*/ | ||
export function consoleSandbox(callback: () => any): any { | ||
export function consoleSandbox<T>(callback: () => T): T { |
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.
as a next step, we can further refactor consoleSandbox
to take a level
argument, so we don't have to un-patch and re-patch every single console level every time we call this.
4d489e5
to
5810ace
Compare
Seems Node 6 tests are failing because |
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.
Looks good. Thanks for cleaning up!
@AbhiPrasad I believe this caused #4878 |
Dependent on #4860
Based on work in #4285
Removes the logger class in favour of a function + object. They are functionality identical. While I was here, took the liberty to refactor
consoleSandbox
a little, mainly adjusting the types.Resolves https://getsentry.atlassian.net/browse/WEB-604
Note: This can be merged before
v7
because@sentry/utils
is not considered public API.