Skip to content

console: implement minimal `console.group()`

Rodrigo Muino Tomonari requested to merge github/fork/Trott/console-group into master

Node.js exposes console.group() and console.groupEnd() via the inspector. These functions have no apparent effect when called from Node.js without the inspector. We cannot easily hide them when Node.js is started without the inspector because we support opening the inspector during runtime via inspector.port().

Implement a minimal console.group()/console.groupEnd(). More sophisticated implementations are possible, but they can be done in userland and/or features can be added to this at a later time. (It lacks the label argument to console.group() right now, for example. How to handle label, or even whether to handle it, may become a bikeshed discussion. Landing a minimal implementation first avoids the pitfall of that discussion or a similar discussion delaying the implementation indefinitely.)

Refs: https://github.com/nodejs/node/issues/12675 Fixes: https://github.com/nodejs/node/issues/1716

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

console

Merge request reports

Loading