Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
inspector: add inspector console support for native Console#7988
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
alexkozy commented Aug 5, 2016
jasnell commented Aug 5, 2016
src/node.cc Outdated
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.
I would like to suggest moving this block (and 2 functions above) into inspector_agent.{h,cc} - this way there will be less conditional compilation to maintain.
alexkozy commented Aug 5, 2016
/cc @dgozman |
mscdex commented Aug 5, 2016
Wouldn't it be possible to instead store copies of the original console functions, which would allow us to avoid having to modify |
alexkozy commented Aug 6, 2016
I addressed your comments and moved all changes into inspector_agent.cc and bootstrap_node.js. |
src/inspector_agent.cc Outdated
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.
Let's check that arguments are functions here.
alexkozy commented Aug 6, 2016
Addressed all comments, please take another look! |
lib/internal/bootstrap_node.js Outdated
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.
Still a s/sequentally/sequentially/ typo here.
src/inspector_agent.cc Outdated
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.
Nit: operator should go on previous line.
alexkozy commented Aug 7, 2016
addressed comments, please take another look. |
src/inspector_agent.cc Outdated
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.
Nit: arguments should line up.
bnoordhuis commented Aug 7, 2016
LGTM with a suggestion and a nit. CI: https://ci.nodejs.org/job/node-test-pull-request/3559/ |
alexkozy commented Aug 7, 2016
Thanks! All done. It looks like freebsd test failure doesn't relate to this pull request. |
jasnell commented Aug 8, 2016
LGTM |
lib/internal/bootstrap_node.js Outdated
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.
I would prefer if inspector wasn't a public property on process (except during startup). Could you get away with deleting process.inspector here?
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.
I can remove process.inspector here. Done.
alexkozy commented Aug 8, 2016
All done. Please take another look! |
ofrobots commented Aug 8, 2016
LGTM. New CI: https://ci.nodejs.org/job/node-test-pull-request/3580/. |
lib/internal/bootstrap_node.js Outdated
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.
grammar nit: "then wrap these two methods..."
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.
Also, "will preserve the original stack"
alexkozy commented Aug 9, 2016
Thanks for review. |
src/inspector_agent.cc Outdated
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.
Would prefer the error message to be a bit more descriptive
jasnell commented Aug 9, 2016
LGTM with a nit |
alexkozy commented Aug 9, 2016
Done. |
ofrobots commented Aug 10, 2016
alexkozy commented Aug 11, 2016
This time it was failed on https://ci.nodejs.org/job/node-compile-windows/3631/label=win-vs2015/console . It looks like it doesn't relate to my change, does it? |
ofrobots commented Aug 11, 2016
That seems to be infrastructure related. Windows did pass on the previous build. I think this is good to land. I will do so tomorrow. |
When node is running with --inspect flag, default console.log, console.warn and other methods call inspector console methods in addition to current behaviour (dump formatted message to stderr and stdout). Inspector console methods forward message to DevTools and show its in DevTools Console with DevTools formatters. Inspector console methods not presented on Node console will be added into it. Only own methods on global.console object will be changed while debugging session. User still able to redefine it, use console.Console or change original methods on Console.prototype.
alexkozy commented Aug 12, 2016
I've rebased this pull request to resolve conflicts. |
ofrobots commented Aug 12, 2016
Thanks, landed as f6070a1. |
When node is running with --inspect flag, default console.log, console.warn and other methods call inspector console methods in addition to current behaviour (dump formatted message to stderr and stdout). Inspector console methods forward message to DevTools and show up in DevTools Console with DevTools formatters. Inspector console methods not present on Node console will be added into it. Only own methods on global.console object will be changed while in a debugging session. User are still able to redefine it, use console.Console or change original methods on Console.prototype. PR-URL: #7988 Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]> Reviewed-By: jasnell - James M Snell <[email protected]> Reviewed-By: ofrobots - Ali Ijaz Sheikh <[email protected]>
ofrobots commented Aug 12, 2016
When node is running with --inspect flag, default console.log, console.warn and other methods call inspector console methods in addition to current behaviour (dump formatted message to stderr and stdout). Inspector console methods forward message to DevTools and show up in DevTools Console with DevTools formatters. Inspector console methods not present on Node console will be added into it. Only own methods on global.console object will be changed while in a debugging session. User are still able to redefine it, use console.Console or change original methods on Console.prototype. PR-URL: #7988 Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]> Reviewed-By: jasnell - James M Snell <[email protected]> Reviewed-By: ofrobots - Ali Ijaz Sheikh <[email protected]>

Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
console
Description of change
When node is running with --inspect flag, default console.log,
console.warn and other methods call inspector console methods in
addition to current behaviour (dump formatted message to stderr
and stdout). Inspector console methods forward message to DevTools and
show its in DevTools Console with DevTools formatters. Inspector console
methods not presented on Node console will be added into it.
Only own methods on global.console object will be changed while
debugging session. User still able to redefine it, use console.Console
or change original methods on Console.prototype.