From 51b8a79bd46a28c2f576a579f258c2222e1a951b Mon Sep 17 00:00:00 2001 From: Adrian Estrada Date: Thu, 26 May 2016 11:28:32 -0400 Subject: [PATCH] doc: add `added:` information for console Information extracted from git history. Ref: https://github.com/nodejs/node/issues/6578 PR-URL: https://github.com/nodejs/node/pull/6995 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Julian Duque --- doc/api/console.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/api/console.md b/doc/api/console.md index 3e1472e656ef33..bbb96cb3d3e75d 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -97,6 +97,9 @@ new Console(process.stdout, process.stderr); ``` ### console.assert(value[, message][, ...]) + A simple assertion test that verifies whether `value` is truthy. If it is not, an `AssertionError` is thrown. If provided, the error `message` is formatted @@ -150,6 +153,9 @@ console.log('this will also print'); ``` ### console.dir(obj[, options]) + Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. This function bypasses any custom `inspect()` function defined on `obj`. An @@ -168,6 +174,9 @@ Defaults to `false`. Colors are customizable; see [customizing `util.inspect()` colors][]. ### console.error([data][, ...]) + Prints to `stderr` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution @@ -187,10 +196,16 @@ If formatting elements (e.g. `%d`) are not found in the first string then values are concatenated. See [`util.format()`][] for more information. ### console.info([data][, ...]) + The `console.info()` function is an alias for [`console.log()`][]. ### console.log([data][, ...]) + Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution @@ -210,6 +225,9 @@ If formatting elements (e.g. `%d`) are not found in the first string then values are concatenated. See [`util.format()`][] for more information. ### console.time(label) + Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. Use the same `label` when you call @@ -217,6 +235,9 @@ are identified by a unique `label`. Use the same `label` when you call milliseconds to stdout. Timer durations are accurate to the sub-millisecond. ### console.timeEnd(label) + Stops a timer that was previously started by calling [`console.time()`][] and prints the result to stdout: @@ -236,6 +257,9 @@ leaking it. On older versions, the timer persisted. This allowed functionality was unintended and is no longer supported.* ### console.trace(message[, ...]) + Prints to `stderr` the string `'Trace :'`, followed by the [`util.format()`][] formatted message and stack trace to the current position in the code. @@ -257,6 +281,9 @@ console.trace('Show me'); ``` ### console.warn([data][, ...]) + The `console.warn()` function is an alias for [`console.error()`][].