-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: add description for inspector-only console methods. #17004
Changes from 11 commits
bbf4ffa
eab906a
c95317d
757f182
1bef307
d9ec8a3
fd88a45
343a92d
0d06595
9ffff7b
38f49c2
1d9981f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,6 +241,10 @@ undefined | |
### console.debug(data[, ...args]) | ||
<!-- YAML | ||
added: v8.0.0 | ||
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/17033 | ||
description: "`console.debug` is now an alias for `console.log`." | ||
--> | ||
* `data` {any} | ||
* `...args` {any} | ||
|
@@ -426,15 +430,110 @@ added: v0.1.100 | |
|
||
The `console.warn()` function is an alias for [`console.error()`][]. | ||
|
||
## Inspector only methods | ||
The following methods are exposed by the V8 engine in the general API but do | ||
not display anything unless used in conjunction with the [inspector][] | ||
(`--inspect` flag). | ||
|
||
### console.dirxml(object) | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `object` {string} | ||
|
||
This method does not display anything unless used in the inspector. The | ||
`console.dirxml()` method displays in `stdout` an XML interactive tree | ||
representation of the descendants of the specified `object` if possible, or the | ||
JavaScript representation if not. Calling `console.dirxml()` on an HTML or XML | ||
element is equivalent to calling `console.log()`. | ||
|
||
### console.markTimeline(label) | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `label` {string} Defaults to `'default'`. | ||
|
||
This method does not display anything unless used in the inspector. The | ||
`console.markTimeline()` method is the deprecated form of [`console.timeStamp()`][]. | ||
|
||
### console.profile([label]) | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `label` {string} | ||
|
||
This method does not display anything unless used in the inspector. The | ||
`console.profile()` method starts a JavaScript CPU profile with an optional | ||
label until [`console.profileEnd()`][] is called. The profile is then added to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A nit: undefined reference |
||
the **Profile** panel of the inspector. | ||
```js | ||
console.profile('MyLabel'); | ||
// Some code | ||
console.profileEnd(); | ||
// Adds the profile 'MyLabel' to the Profiles panel of the inspector. | ||
``` | ||
|
||
### console.profileEnd() | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
|
||
This method does not display anything unless used in the inspector. Stops the | ||
current JavaScript CPU profiling session if one has been started and prints | ||
the report to the **Profiles** panel of the inspector. See | ||
[`console.profile()`][] for an example. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A nit: undefined reference |
||
|
||
### console.table(array[, ...args]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a rest param, should be |
||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `array` {Array|Object} | ||
* `...args` {any} | ||
|
||
This method does not display anything unless used in the inspector. Prints to | ||
`stdout` the array `array` formatted as a table. | ||
|
||
### console.timeStamp([label]) | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `label` {string} | ||
|
||
This method does not display anything unless used in the inspector. The | ||
`console.timeStamp()` method adds an event with the label `label` to the | ||
**Timeline** panel of the inspector. | ||
|
||
### console.timeline([label]) | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `label` {string} Defaults to `'default'`. | ||
|
||
This method does not display anything unless used in the inspector. The | ||
`console.timeline()` method is the deprecated form of [`console.time()`][]. | ||
|
||
### console.timelineEnd([label]) | ||
<!-- YAML | ||
added: v8.0.0 | ||
--> | ||
* `label` {string} Defaults to `'default'`. | ||
|
||
This method does not display anything unless used in the inspector. The | ||
`console.timelineEnd()` method is the deprecated form of [`console.timeEnd()`][]. | ||
|
||
[`console.error()`]: #console_console_error_data_args | ||
[`console.group()`]: #console_console_group_label | ||
[`console.log()`]: #console_console_log_data_args | ||
[`console.profile()`]: #console_console_profile_label | ||
[`console.profileEnd()`]: #console_console_profileend | ||
[`console.time()`]: #console_console_time_label | ||
[`console.timeEnd()`]: #console_console_timeend_label | ||
[`console.timeStamp()`]: #console_console_timestamp_label | ||
[`process.stderr`]: process.html#process_process_stderr | ||
[`process.stdout`]: process.html#process_process_stdout | ||
[`util.format()`]: util.html#util_util_format_format_args | ||
[`util.inspect()`]: util.html#util_util_inspect_object_options | ||
[customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors | ||
[inspector]: debugger.html | ||
[note on process I/O]: process.html#process_a_note_on_process_i_o | ||
[web-api-assert]: https://developer.mozilla.org/en-US/docs/Web/API/console/assert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this argument missing from the header?