diff options
author | Rich Trott <rtrott@gmail.com> | 2017-08-17 22:41:14 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-08-23 18:46:14 -0700 |
commit | c40229a9b80736f1fdb31fac169b70a1d6af8669 (patch) | |
tree | 5c19099000c3bffc33468f77c2919d0c253f810d /doc/api/console.md | |
parent | c6da5c8cdfae9e80d63f090c4289fd146c3175df (diff) | |
download | android-node-v8-c40229a9b80736f1fdb31fac169b70a1d6af8669.tar.gz android-node-v8-c40229a9b80736f1fdb31fac169b70a1d6af8669.tar.bz2 android-node-v8-c40229a9b80736f1fdb31fac169b70a1d6af8669.zip |
console: implement minimal `console.group()`
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.
`console.groupCollapsed()` is implemented as an alias for
`console.group()`.
PR-URL: https://github.com/nodejs/node/pull/14910
Fixes: https://github.com/nodejs/node/issues/1716
Ref: https://github.com/nodejs/node/issues/12675
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc/api/console.md')
-rw-r--r-- | doc/api/console.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/api/console.md b/doc/api/console.md index 08fcfa027c..ee130d7b97 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -286,6 +286,32 @@ If formatting elements (e.g. `%d`) are not found in the first string then [`util.inspect()`][] is called on each argument and the resulting string values are concatenated. See [`util.format()`][] for more information. +### console.group([...label]) +<!-- YAML +added: REPLACEME +--> + +* `label` {any} + +Increases indentation of subsequent lines by two spaces. + +If one or more `label`s are provided, those are printed first without the +additional indentation. + +### console.groupCollapsed() +<!-- YAML + added: REPLACEME +--> + +An alias for [`console.group()`][]. + +### console.groupEnd() +<!-- YAML +added: REPLACEME +--> + +Decreases indentation of subsequent lines by two spaces. + ### console.info([data][, ...args]) <!-- YAML added: v0.1.100 @@ -390,6 +416,7 @@ added: v0.1.100 The `console.warn()` function is an alias for [`console.error()`][]. [`console.error()`]: #console_console_error_data_args +[`console.group()`]: #console_console_group_label [`console.log()`]: #console_console_log_data_args [`console.time()`]: #console_console_time_label [`console.timeEnd()`]: #console_console_timeend_label |