Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: replace console.warn with process.emitWarning#954

Merged
RyanZim merged 1 commit intojprichardson:masterfrom
lamweili:refactor/warning-mechanism
Apr 16, 2022
Merged

refactor: replace console.warn with process.emitWarning#954
RyanZim merged 1 commit intojprichardson:masterfrom
lamweili:refactor/warning-mechanism

Conversation

Copy link
Contributor

lamweili commented Apr 8, 2022 *
edited
Loading

To have consistent warnings from #953 (comment) by @JPeer264

Yes process.emitWarning sounds also like a great option to add (just my opinion on it). However, a separate PR would be nice if you want to go the extra mile as we squash our PRs. @manidlou @RyanZim @jprichardson any objections?

Prints out via process.emitWarning in the following format:

lamweili mentioned this pull request Apr 8, 2022
lamweili marked this pull request as draft April 8, 2022 17:21
lamweili marked this pull request as ready for review April 8, 2022 17:53
lamweili marked this pull request as draft April 8, 2022 17:55
lamweili marked this pull request as ready for review April 8, 2022 17:55
Copy link
Collaborator

RyanZim commented Apr 8, 2022

Should we consider this: https://nodejs.org/api/process.html#avoiding-duplicate-warnings?

Copy link
Contributor Author

lamweili commented Apr 8, 2022 *
edited
Loading

My motivation was to retain the behavior of the console.warn which warns duplicatedly if called multiple times.

Should we change it to use https://nodejs.org/api/process.html#avoiding-duplicate-warnings instead, so it only warns on the first time?

What do you guy think? Let me know and I'll make the adjustments.
@RyanZim @JPeer264 @manidlou @jprichardson

JPeer264 approved these changes Apr 9, 2022
Copy link
Collaborator

JPeer264 left a comment

Choose a reason for hiding this comment

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

I am fine with either. Thanks for the changes and your efforts :)

lamweili reacted with hooray emoji
RyanZim merged commit baa9934 into jprichardson:master Apr 16, 2022
lamweili deleted the refactor/warning-mechanism branch April 17, 2022 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

JPeer264 JPeer264 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants