-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Node LogPoints shows up as the VM source in debug console #47274
Comments
The log event from Node contains the full stack, but the top frame is in an eval context. So I just have to identify a message from a logpoint and knock off the top frame. I could do this by adding an extra argument to the end of the console.log that we send to the runtime with some identifiable string that identifies this log event as belonging to a logpoint. It's simple but the magic string would show up if you attach Chrome devtools at the same time. Or I could look at the stack and check whether it comes from a line that we have an active logpoint on. I'll go with the first for now as it's simpler and stateless. |
Your approach works fine for the debug console but in the integrated terminal it results in this: Instead of using Or just use some NO-OP ANSI-Escape sequence... |
Dang... I'm worried that using special characters could cause weird issues somewhere. But it would be easier. I could also use sourceURL on the script to tag it as ours. |
I don't know how this works, but it sounds good! Alternative: Or you could wrap the console.log in another function with a special marker name so you could find it easily in the stack. |
If you add a special comment to the end of an evaluated script, |
@roblourens Doesn't this change make all logpoints showup coming from the same file, and not the original? |
No, I use sourceURL to mark them as logpoints so I know to hide the eval stack frame. The user won't see it. |
@roblourens Roger |
Per conversation microsoft/vscode-node-debug#174
Node LogPoints shows up as a virtual source, and not a real source from where the LogPoint is set.
Example:
The text was updated successfully, but these errors were encountered: