-
Notifications
You must be signed in to change notification settings - Fork 25k
Also call the original console methods if they exist
#2486
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
|
@vjeux this is the console patch we briefly mentioned |
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.
2 spaces please :)
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.
Done!
Ex. When `console.log` or similar is called, this will call the original method, which can be quite useful. For example, under iOS, this will log to the Safari console debugger, which has an expandable UI for inspecting objects, etc., and is also just useful if you are using that as a REPL. I don't believe this incurs a meaningful performance penalty unless the console is open, but it would be easy to stick behind a flag if that is a problem.
|
Thanks. Let me try it out and see how it looks like on Chrome. I'm afraid that it will show the console.log twice. |
|
@facebook-github-bot import |
|
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/920634044695466/int_phab to review. |
|
@facebook-github-bot shipit |
|
We've been using the Chrome debugger and the logs haven't shown up twice because the polyfill bails out if |
|
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/920634044695466/int_phab to review. |
Summary: Ex. When `console.log` or similar is called, this will call the original method, which can be quite useful. For example, under iOS, this will log to the Safari console debugger, which has an expandable UI for inspecting objects, etc., and is also just useful if you are using that as a REPL. I don't believe this incurs a meaningful performance penalty unless the console is open, but it would be easy to stick behind a flag if that is a problem. Closes facebook#2486 Reviewed By: @svcscm Differential Revision: D2472470 Pulled By: @vjeux
Summary: Ex. When `console.log` or similar is called, this will call the original method, which can be quite useful. For example, under iOS, this will log to the Safari console debugger, which has an expandable UI for inspecting objects, etc., and is also just useful if you are using that as a REPL. I don't believe this incurs a meaningful performance penalty unless the console is open, but it would be easy to stick behind a flag if that is a problem. Closes facebook/react-native#2486 Reviewed By: @svcscm Differential Revision: D2472470 Pulled By: @vjeux
Ex. When
console.logor similar is called, this will callthe original method, which can be quite useful.
For example, under iOS, this will log to the Safari console debugger,
which has an expandable UI for inspecting objects, etc., and is also
just useful if you are using that as a REPL.
I don't believe this incurs a meaningful performance penalty unless
the console is open, but it would be easy to stick behind a flag
if that is a problem.