| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 57ee0dd commit 74506f7
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -241,6 +241,10 @@ undefined | |||
| 241 | 241 | ### console.debug(data[, ...args]) | |
| 242 | 242 | <!-- YAML | |
| 243 | 243 | added: v8.0.0 | |
| 244 | + changes: | ||
| 245 | + - version: REPLACEME | ||
| 246 | + pr-url: https://github.com/nodejs/node/pull/17033 | ||
| 247 | + description: "`console.debug` is now an alias for `console.log`." | ||
| 244 | 248 | --> | |
| 245 | 249 | * `data` {any} | |
| 246 | 250 | * `...args` {any} | |
@@ -426,15 +430,110 @@ added: v0.1.100 | |||
| 426 | 430 | ||
| 427 | 431 | The `console.warn()` function is an alias for [`console.error()`][]. | |
| 428 | 432 | ||
| 433 | + ## Inspector only methods | ||
| 434 | + The following methods are exposed by the V8 engine in the general API but do | ||
| 435 | + not display anything unless used in conjunction with the [inspector][] | ||
| 436 | + (`--inspect` flag). | ||
| 437 | + | ||
| 438 | + ### console.dirxml(object) | ||
| 439 | + <!-- YAML | ||
| 440 | + added: v8.0.0 | ||
| 441 | + --> | ||
| 442 | + * `object` {string} | ||
| 443 | + | ||
| 444 | + This method does not display anything unless used in the inspector. The | ||
| 445 | + `console.dirxml()` method displays in `stdout` an XML interactive tree | ||
| 446 | + representation of the descendants of the specified `object` if possible, or the | ||
| 447 | + JavaScript representation if not. Calling `console.dirxml()` on an HTML or XML | ||
| 448 | + element is equivalent to calling `console.log()`. | ||
| 449 | + | ||
| 450 | + ### console.markTimeline(label) | ||
| 451 | + <!-- YAML | ||
| 452 | + added: v8.0.0 | ||
| 453 | + --> | ||
| 454 | + * `label` {string} Defaults to `'default'`. | ||
| 455 | + | ||
| 456 | + This method does not display anything unless used in the inspector. The | ||
| 457 | + `console.markTimeline()` method is the deprecated form of [`console.timeStamp()`][]. | ||
| 458 | + | ||
| 459 | + ### console.profile([label]) | ||
| 460 | + <!-- YAML | ||
| 461 | + added: v8.0.0 | ||
| 462 | + --> | ||
| 463 | + * `label` {string} | ||
| 464 | + | ||
| 465 | + This method does not display anything unless used in the inspector. The | ||
| 466 | + `console.profile()` method starts a JavaScript CPU profile with an optional | ||
| 467 | + label until [`console.profileEnd()`][] is called. The profile is then added to | ||
| 468 | + the **Profile** panel of the inspector. | ||
| 469 | + ```js | ||
| 470 | + console.profile('MyLabel'); | ||
| 471 | + // Some code | ||
| 472 | + console.profileEnd(); | ||
| 473 | + // Adds the profile 'MyLabel' to the Profiles panel of the inspector. | ||
| 474 | + ``` | ||
| 475 | + | ||
| 476 | + ### console.profileEnd() | ||
| 477 | + <!-- YAML | ||
| 478 | + added: v8.0.0 | ||
| 479 | + --> | ||
| 480 | + | ||
| 481 | + This method does not display anything unless used in the inspector. Stops the | ||
| 482 | + current JavaScript CPU profiling session if one has been started and prints | ||
| 483 | + the report to the **Profiles** panel of the inspector. See | ||
| 484 | + [`console.profile()`][] for an example. | ||
| 485 | + | ||
| 486 | + ### console.table(array[, columns]) | ||
| 487 | + <!-- YAML | ||
| 488 | + added: v8.0.0 | ||
| 489 | + --> | ||
| 490 | + * `array` {Array|Object} | ||
| 491 | + * `columns` {Array} | ||
| 492 | + | ||
| 493 | + This method does not display anything unless used in the inspector. Prints to | ||
| 494 | + `stdout` the array `array` formatted as a table. | ||
| 495 | + | ||
| 496 | + ### console.timeStamp([label]) | ||
| 497 | + <!-- YAML | ||
| 498 | + added: v8.0.0 | ||
| 499 | + --> | ||
| 500 | + * `label` {string} | ||
| 501 | + | ||
| 502 | + This method does not display anything unless used in the inspector. The | ||
| 503 | + `console.timeStamp()` method adds an event with the label `label` to the | ||
| 504 | + **Timeline** panel of the inspector. | ||
| 505 | + | ||
| 506 | + ### console.timeline([label]) | ||
| 507 | + <!-- YAML | ||
| 508 | + added: v8.0.0 | ||
| 509 | + --> | ||
| 510 | + * `label` {string} Defaults to `'default'`. | ||
| 511 | + | ||
| 512 | + This method does not display anything unless used in the inspector. The | ||
| 513 | + `console.timeline()` method is the deprecated form of [`console.time()`][]. | ||
| 514 | + | ||
| 515 | + ### console.timelineEnd([label]) | ||
| 516 | + <!-- YAML | ||
| 517 | + added: v8.0.0 | ||
| 518 | + --> | ||
| 519 | + * `label` {string} Defaults to `'default'`. | ||
| 520 | + | ||
| 521 | + This method does not display anything unless used in the inspector. The | ||
| 522 | + `console.timelineEnd()` method is the deprecated form of [`console.timeEnd()`][]. | ||
| 523 | + | ||
| 429 | 524 | [`console.error()`]: #console_console_error_data_args | |
| 430 | 525 | [`console.group()`]: #console_console_group_label | |
| 431 | 526 | [`console.log()`]: #console_console_log_data_args | |
| 527 | + [`console.profile()`]: #console_console_profile_label | ||
| 528 | + [`console.profileEnd()`]: #console_console_profileend | ||
| 432 | 529 | [`console.time()`]: #console_console_time_label | |
| 433 | 530 | [`console.timeEnd()`]: #console_console_timeend_label | |
| 531 | + [`console.timeStamp()`]: #console_console_timestamp_label | ||
| 434 | 532 | [`process.stderr`]: process.html#process_process_stderr | |
| 435 | 533 | [`process.stdout`]: process.html#process_process_stdout | |
| 436 | 534 | [`util.format()`]: util.html#util_util_format_format_args | |
| 437 | 535 | [`util.inspect()`]: util.html#util_util_inspect_object_options | |
| 438 | 536 | [customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors | |
| 537 | + [inspector]: debugger.html | ||
| 439 | 538 | [note on process I/O]: process.html#process_a_note_on_process_i_o | |
| 440 | 539 | [web-api-assert]: https://developer.mozilla.org/en-US/docs/Web/API/console/assert | |
| Back | FazBrowse Home | New Git URL |
0 commit comments