-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Debug console loses ability to differentiate lines of output #175763
Comments
I think that using Winston writing directly to stdout here will be the issue, because then there is just a stream of output and no correspondence between calling some log API and one "message". Grabbing some logs might help verify that's the issue. /jsDebugLogs |
Please collect trace logs using the following instructions:
|
Thanks Rob. I've attached the VSCode logs and the debug console output. Here's the launch configuration: {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Sutro Server",
"skipFiles": ["<node_internals>/**"],
"runtimeArgs": [
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register",
"--expose-gc"
],
"args": "${workspaceFolder}/server.ts",
"console": "internalConsole",
"internalConsoleOptions": "openOnSessionStart",
"outputCapture": "std",
"env": {
"NODE_ENV": "DEV",
"SUTRO_LOG_LEVEL": "debug"
},
"trace": true
}
]
} Note that Each debug console log entry starts with a date, an option service name in parentheses, a level in square brackets and then the data. Some log entries are multiline. The file lines starting at 702 all the way up to and including 1164 are identified in the Debug Console as being the same line. |
In the debugger we just do |
You can have a multiline log output message too, the loom shows this. But maybe splitting single messages by line is better than combining messages randomly? |
FWIW - I have a few thoughts on what I could work with.
|
A framework-agnostic version could be to support This would need an opt-in approach. In this mode, the JS DAP implementation would store incoming data and only call I'd be happy to have a crack at implementing this if you think it seems sensible. |
The I think splitting by lines is probably fine. If we wanted to be slightly more creative, we could automatically start splitting by EXT if we encounter one in the stream.
The program lives several layers above DAP, this is not very feasible |
Took a crack at an implementation. Be gentle :) |
Or you could use a transport that calls |
Ahem... Yeah... Or that :) |
Even that's not guaranteed, we don't know how the OS will chunk output to us |
Yeah, it looks like However, I was (perhaps mistakenly) under the impression from here that VSCode somehow intercepts calls to |
Yea, we get them in that event over CDP. It does some magic, such as putting objects in the "console" group so that they can be examined and don't get garabage collected as soon as they fall out of scope, for example. Node.js emits that event, though I'm not sure where internally that happens. You might be looking at the wrong thing, though, as Node.js also has a console API that does not result in that event getting fired. |
Hey, @connor4312 I am new to programming and use vs code for my projects. I would love to contribute to this project. |
Thanks for volunteering, but Dan already put in a PR (which I just merged 🙂 ) |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
It's not 100% clear to me what the definitive recreate is. Initially, I thought it was something to do with code that outputs multiline log entries, but while testing with Extensions disabled, I realized that observation was a red herring.
I created a Loom to show the issue:
https://www.loom.com/share/66777e9fdb774a4186db493d02091667
In short, the Debug console starts by identifying individual output lines as I would expect; then it clumps a bunch of lines together as if they are one; then it goes back to single lines.
The impact is that output filtering doesn't work properly, which makes some debugging tasks very difficult.
The text was updated successfully, but these errors were encountered: