You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we introduce a concept like this into the debug protocol, and improve the display to support collapsible sections of logs? Do other runtimes have a concept like this?
It's now more visible when debugging vscode.
Reacted by Graham McGregor, Keith Townsend, Jussi Laitinen, rdegelo, Michaël Fortin, Giuseppe, Elliott, Patryk Ludwikowski, Simone Todisco, Ilya Komichev and 5 more
The markup is just something I added so the group/groupEnd calls aren't totally invisible.
My original example isn't the best example, it's logging a single item as a one-off group. In your screenshot it looks like you're logging an array of strings, which is possible, but I don't think it's the right model for logging a group.
The group should be updated live as log messages are produced, where an array could only be logged once the group is closed. At least I don't think I can log an object, then change the object.
Groups should be expanded by default
They need a log location for each line
Nested groups should look good
Multiline group titles and grouped messages should look good
My summary of the node.js console.group documentation:
console.group(one or more labels):
Increases indentation of subsequent lines by two spaces.
If one or more labels are provided, those are printed first without the additional indentation.
If group is shown with a collapsable/expandable UI, it should be initially expanded.
console.groupCollapsed():
Increases indentation of subsequent lines by two spaces.
If group is shown with a collapsable/expandable UI, it should be initially collapsed.
console.groupEnd():
Decreases indentation of subsequent lines by two spaces.
My DAP proposal:
We add an optional enum property group to the Output event with these values:
start: start a new group in expanded mode. Subsequent Output events are members of the group and should be shown indented. An optional output attribute becomes the name of the group and is not indented.
startCollapsed: start a new group in collapsed mode. Subsequent Output events are members of the group and should be shown indented (as soon as the group is expanded). An optional output attribute becomes the name of the group and is not indented.
end: end the current group and decreases the indentation of subsequent Output events.
Connor Peet (@connor4312)roblourens it would be very cool if the node2 or the javascript debugger could support console groups this milestone, then we could add a test plan item which uses node and not mock debug. Anyways let me know how it goes, so I prepare a test plan item in time. Thanks!
It would be a 💪 to do in the remaining days this iteration, but the test plan could literally for Rob or I to implement and verify grouping in js-debug. Andre has written a few items like that for me in the past 🙂
Connor Peet (@connor4312) writing a test plan like that would work for me. Let's see the status on this tomorrow evening and I will update the test plan accordingly. Thanks!
Activity
auchenberg commentedon Sep 25, 2017
Our console for sure would gain much with simple object formatting / tree structure. Is the debug console rendering virtualized today?
weinand commentedon Sep 25, 2017
The debug console is based on a tree, so this should be simple to implement.
weinand commentedon Nov 8, 2017
roblourens is the
<Start group>/<End group>markup your adhoc invention and the DA is adding this to the stack trace or does this come from CDP?I was able to achieve the following with the existing DAP:
So, the only issue is the array index that appears in front of the stack frames (but we could call this a feature).
The missing link detection is an orthogonal issue that we will fix anyway.
roblourens commentedon Nov 8, 2017
The markup is just something I added so the group/groupEnd calls aren't totally invisible.
My original example isn't the best example, it's logging a single item as a one-off group. In your screenshot it looks like you're logging an array of strings, which is possible, but I don't think it's the right model for logging a group.
weinand commentedon Nov 8, 2017
What are "good" examples for a dynamic group?
What do you mean by "They need a log location for each line"?
roblourens commentedon Nov 8, 2017
Code like
Looks like this in chrome devtools
By "log location" I mean the location that we added for each log last month.
23 remaining items
isidorn commentedon Feb 11, 2020
Adding this to the February milestone since it is on the plan.
Once we have this in the debug adapter protocol I can look into the implementation.
weinand commentedon Feb 18, 2020
My summary of the node.js console.group documentation:
console.group(one or more labels):Increases indentation of subsequent lines by two spaces.
If one or more labels are provided, those are printed first without the additional indentation.
If group is shown with a collapsable/expandable UI, it should be initially expanded.
console.groupCollapsed():Increases indentation of subsequent lines by two spaces.
If group is shown with a collapsable/expandable UI, it should be initially collapsed.
console.groupEnd():Decreases indentation of subsequent lines by two spaces.
My DAP proposal:
We add an optional enum property
groupto theOutputevent with these values:start: start a new group in expanded mode. Subsequent Output events are members of the group and should be shown indented. An optionaloutputattribute becomes the name of the group and is not indented.startCollapsed: start a new group in collapsed mode. Subsequent Output events are members of the group and should be shown indented (as soon as the group is expanded). An optionaloutputattribute becomes the name of the group and is not indented.end: end the current group and decreases the indentation of subsequent Output events./cc Isidor Nikolic (@isidorn) roblourens Connor Peet (@connor4312)
weinand commentedon Feb 18, 2020
For further discussion of the group feature in the DAP, I've create this issue.
weinand commentedon Feb 18, 2020
Isidor Nikolic (@isidorn) I've added a group attribute to DAP and updated
debugProtocol.d.tsin VS Code.isidorn commentedon Feb 20, 2020
I have pushed support for this.
Andre Weinand (@weinand) thanks for adding the protocol!
Connor Peet (@connor4312) roblourens it would be very cool if the node2 or the javascript debugger could support console groups this milestone, then we could add a test plan item which uses node and not mock debug. Anyways let me know how it goes, so I prepare a test plan item in time. Thanks!
connor4312 commentedon Feb 20, 2020
It would be a 💪 to do in the remaining days this iteration, but the test plan could literally for Rob or I to implement and verify grouping in js-debug. Andre has written a few items like that for me in the past 🙂
isidorn commentedon Feb 20, 2020
Connor Peet (@connor4312) writing a test plan like that would work for me. Let's see the status on this tomorrow evening and I will update the test plan accordingly. Thanks!
weinand commentedon Feb 20, 2020
Great idea to implement the protocol for js-debug as part of the test plan item ;-)