-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Add an option to DevTools to enable double-logging #19710
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4af8e58:
|
d534a1a
to
74e41ce
Compare
74e41ce
to
818c480
Compare
Hi @Jchinonso. What's the purpose of this change? |
|
There are two things that override the console:
Such a setting as the one you're adding here could be used to control the 2nd (DevTools) but I don't think anyone is asking for us to stop disabling the console in that case– so I assume you're targeting the first (React's disabling of the console, added in #18547). That code wasn't written to be turned on or off externally (by something like DevTools). It's built into React. Allowing DevTools to control it (via a new setting like the one you're proposing) would require updating React as well. Not sure how I feel about this feature 😄 but I'll be happy to look over the code when it's ready. |
@bvaughn thanks for the clarification, I saw the patching on the console for both devtools and react and was confused on how to approach this. Now i know, i will take the React route |
bcde38c
to
a805d90
Compare
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.
Thanks for working on this! I think we need to change a few things.
packages/react-devtools-shared/src/devtools/views/Settings/DebuggingSettings.js
Outdated
Show resolved
Hide resolved
a805d90
to
01fdf1f
Compare
packages/react-devtools-shared/src/devtools/views/Settings/DebuggingSettings.js
Outdated
Show resolved
Hide resolved
3ec4571
to
86f58d3
Compare
6c5a6dd
to
42dccfe
Compare
42dccfe
to
cb1f767
Compare
cb1f767
to
4af8e58
Compare
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Replaced by #22030 |
Summary
We currently plan to suppress double-logging in development by overriding console in #18547. However, this can be confusing for some scenarios and double logging may be preferable in them. This change adds a toggle to DevTools that would allow to re-enable it on this screen:
Test Plan