whatwg / console

Console Standard
https://console.spec.whatwg.org/
Other
269 stars 67 forks source link

Deprecate groupCollapsed in favor of group and groupEnd #229

Open adderek opened 9 months ago

adderek commented 9 months ago

What is the issue with the Console Standard?

In my opinion .groupCollapsed is meaningless because usually you don't know in advance whether the group should be collapsed or not.

What I propose instead:

/**
 * @function groupEnd
 * @memberof console
 * @param {string|undefined} [label] Defaults to current group.
 * @param {boolean} [unfold] If true then group should remain unfolded. Default is false.
 */

Though I would prefer to leave this entirely to the Output to decide whether it should be folded or not (preferably fold everything unless there is an error or group is still not ended)