Skip to content

Commit 94adfe9

Browse files
committedApr 22, 2019
lib: replace --diagnostic-report-* with --report-*
In the code base the word `report` is almost only used to refer to the diagnostic report when it's a noun, and it's programmable interface `process.report()` it not prefixed, so `report` should be unambiguous enough to use without `diagnostic`. PR-URL: #27312 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 19e3e02 commit 94adfe9

9 files changed

+154
-124
lines changed
 

‎doc/api/cli.md

+87-57
Original file line numberDiff line numberDiff line change
@@ -106,57 +106,6 @@ should be written to. When used alone, it implies `--cpu-prof`.
106106
$ node --cpu-prof-path /tmp/test.cpuprofile index.js
107107
```
108108

109-
### `--diagnostic-report-directory=directory`
110-
<!-- YAML
111-
added: v11.8.0
112-
-->
113-
114-
Location at which the report will be generated.
115-
116-
### `--diagnostic-report-filename=filename`
117-
<!-- YAML
118-
added: v11.8.0
119-
-->
120-
121-
Name of the file to which the report will be written.
122-
123-
### `--diagnostic-report-on-fatalerror`
124-
<!-- YAML
125-
added: v11.8.0
126-
-->
127-
128-
Enables the report to be triggered on fatal errors (internal errors within
129-
the Node.js runtime such as out of memory) that lead to termination of the
130-
application, if `--experimental-report` is enabled. Useful to inspect various
131-
diagnostic data elements such as heap, stack, event loop state, resource
132-
consumption etc. to reason about the fatal error.
133-
134-
### `--diagnostic-report-on-signal`
135-
<!-- YAML
136-
added: v11.8.0
137-
-->
138-
139-
Enables report to be generated upon receiving the specified (or predefined)
140-
signal to the running Node.js process, if `--experimental-report` is enabled.
141-
The signal to trigger the report is specified through `--diagnostic-report-signal`.
142-
143-
### `--diagnostic-report-signal=signal`
144-
<!-- YAML
145-
added: v11.8.0
146-
-->
147-
148-
Sets or resets the signal for report generation (not supported on Windows).
149-
Default signal is `SIGUSR2`.
150-
151-
### `--diagnostic-report-uncaught-exception`
152-
<!-- YAML
153-
added: v11.8.0
154-
-->
155-
156-
Enables report to be generated on un-caught exceptions, if
157-
`--experimental-report` is enabled. Useful when inspecting JavaScript stack in
158-
conjunction with native stack and other runtime environment data.
159-
160109
### `--enable-fips`
161110
<!-- YAML
162111
added: v6.0.0
@@ -492,6 +441,87 @@ file will be created if it does not exist, and will be appended to if it does.
492441
If an error occurs while attempting to write the warning to the file, the
493442
warning will be written to stderr instead.
494443

444+
### `--report-directory=directory`
445+
<!-- YAML
446+
added: v11.8.0
447+
changes:
448+
- version: REPLACEME
449+
pr-url: https://github.com/nodejs/node/pull/27312
450+
description: Changed from `--diagnostic-report-directory` to
451+
`--report-directory`
452+
-->
453+
454+
Location at which the report will be generated.
455+
456+
### `--report-filename=filename`
457+
<!-- YAML
458+
added: v11.8.0
459+
changes:
460+
- version: REPLACEME
461+
pr-url: https://github.com/nodejs/node/pull/27312
462+
description: changed from `--diagnostic-report-filename` to
463+
`--report-filename`
464+
-->
465+
466+
Name of the file to which the report will be written.
467+
468+
### `--report-on-fatalerror`
469+
<!-- YAML
470+
added: v11.8.0
471+
changes:
472+
- version: REPLACEME
473+
pr-url: https://github.com/nodejs/node/pull/27312
474+
description: changed from `--diagnostic-report-on-fatalerror` to
475+
`--report-on-fatalerror`
476+
-->
477+
478+
Enables the report to be triggered on fatal errors (internal errors within
479+
the Node.js runtime such as out of memory) that lead to termination of the
480+
application, if `--experimental-report` is enabled. Useful to inspect various
481+
diagnostic data elements such as heap, stack, event loop state, resource
482+
consumption etc. to reason about the fatal error.
483+
484+
### `--report-on-signal`
485+
<!-- YAML
486+
added: v11.8.0
487+
changes:
488+
- version: REPLACEME
489+
pr-url: https://github.com/nodejs/node/pull/27312
490+
description: changed from `--diagnostic-report-on-signal` to
491+
`--report-on-signal`
492+
-->
493+
494+
Enables report to be generated upon receiving the specified (or predefined)
495+
signal to the running Node.js process, if `--experimental-report` is enabled.
496+
The signal to trigger the report is specified through `--report-signal`.
497+
498+
### `--report-signal=signal`
499+
<!-- YAML
500+
added: v11.8.0
501+
changes:
502+
- version: REPLACEME
503+
pr-url: https://github.com/nodejs/node/pull/27312
504+
description: changed from `--diagnostic-report-signal` to
505+
`--report-signal`
506+
-->
507+
508+
Sets or resets the signal for report generation (not supported on Windows).
509+
Default signal is `SIGUSR2`.
510+
511+
### `--report-uncaught-exception`
512+
<!-- YAML
513+
added: v11.8.0
514+
changes:
515+
- version: REPLACEME
516+
pr-url: https://github.com/nodejs/node/pull/27312
517+
description: changed from `--diagnostic-report-uncaught-exception` to
518+
`--report-uncaught-exception`
519+
-->
520+
521+
Enables report to be generated on un-caught exceptions, if
522+
`--experimental-report` is enabled. Useful when inspecting JavaScript stack in
523+
conjunction with native stack and other runtime environment data.
524+
495525
### `--throw-deprecation`
496526
<!-- YAML
497527
added: v0.11.14
@@ -813,12 +843,12 @@ In case an option value happens to contain a space (for example a path listed in
813843
```
814844

815845
Node.js options that are allowed are:
816-
- `--diagnostic-report-directory`
817-
- `--diagnostic-report-filename`
818-
- `--diagnostic-report-on-fatalerror`
819-
- `--diagnostic-report-on-signal`
820-
- `--diagnostic-report-signal`
821-
- `--diagnostic-report-uncaught-exception`
846+
- `--report-directory`
847+
- `--report-filename`
848+
- `--report-on-fatalerror`
849+
- `--report-on-signal`
850+
- `--report-signal`
851+
- `--report-uncaught-exception`
822852
- `--enable-fips`
823853
- `--experimental-modules`
824854
- `--experimental-repl-await`

‎doc/api/report.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ is provided below for reference.
3232
"commandLine": [
3333
"/home/nodeuser/project/node/out/Release/node",
3434
"--experimental-report",
35-
"--diagnostic-report-uncaught-exception",
35+
"--report-uncaught-exception",
3636
"/home/nodeuser/project/node/test/report/test-exception.js",
3737
"child"
3838
],
@@ -361,19 +361,19 @@ is provided below for reference.
361361
## Usage
362362

363363
```bash
364-
node --experimental-report --diagnostic-report-uncaught-exception \
365-
--diagnostic-report-on-signal --diagnostic-report-on-fatalerror app.js
364+
node --experimental-report --report-uncaught-exception \
365+
--report-on-signal --report-on-fatalerror app.js
366366
```
367367

368368
* `--experimental-report` Enables the diagnostic report feature.
369369
In the absence of this flag, use of all other related options will result in
370370
an error.
371371

372-
* `--diagnostic-report-uncaught-exception` Enables report to be generated on
372+
* `--report-uncaught-exception` Enables report to be generated on
373373
un-caught exceptions. Useful when inspecting JavaScript stack in conjunction
374374
with native stack and other runtime environment data.
375375

376-
* `--diagnostic-report-on-signal` Enables report to be generated upon receiving
376+
* `--report-on-signal` Enables report to be generated upon receiving
377377
the specified (or predefined) signal to the running Node.js process. (See below
378378
on how to modify the signal that triggers the report.) Default signal is `SIGUSR2`.
379379
Useful when a report needs to be triggered from another program.
@@ -387,19 +387,19 @@ signal. However, if `SIGUSR2` is already used for other purposes, then this
387387
flag helps to change the signal for report generation and preserve the original
388388
meaning of `SIGUSR2` for the said purposes.
389389

390-
* `--diagnostic-report-on-fatalerror` Enables the report to be triggered on
390+
* `--report-on-fatalerror` Enables the report to be triggered on
391391
fatal errors (internal errors within the Node.js runtime, such as out of memory)
392392
that leads to termination of the application. Useful to inspect various
393393
diagnostic data elements such as heap, stack, event loop state, resource
394394
consumption etc. to reason about the fatal error.
395395

396-
* `--diagnostic-report-directory` Location at which the report will be
396+
* `--report-directory` Location at which the report will be
397397
generated.
398398

399-
* `--diagnostic-report-filename` Name of the file to which the report will be
399+
* `--report-filename` Name of the file to which the report will be
400400
written.
401401

402-
* `--diagnostic-report-signal` Sets or resets the signal for report generation
402+
* `--report-signal` Sets or resets the signal for report generation
403403
(not supported on Windows). Default signal is `SIGUSR2`.
404404

405405
A report can also be triggered via an API call from a JavaScript application:
@@ -534,10 +534,10 @@ Configuration on module initialization is also available via
534534
environment variables:
535535

536536
```bash
537-
NODE_OPTIONS="--experimental-report --diagnostic-report-uncaught-exception \
538-
--diagnostic-report-on-fatalerror --diagnostic-report-on-signal \
539-
--diagnostic-report-signal=SIGUSR2 --diagnostic-report-filename=./report.json \
540-
--diagnostic-report-directory=/home/nodeuser"
537+
NODE_OPTIONS="--experimental-report --report-uncaught-exception \
538+
--report-on-fatalerror --report-on-signal \
539+
--report-signal=SIGUSR2 --report-filename=./report.json \
540+
--report-directory=/home/nodeuser"
541541
```
542542

543543
Specific API documentation can be found under

‎doc/node.1

+36-36
Original file line numberDiff line numberDiff line change
@@ -90,42 +90,6 @@ Path the V8 CPU profile generated with
9090
will be written to. When used alone, it implies
9191
.Fl -cpu-prof
9292
.
93-
.It Fl -diagnostic-report-directory
94-
Location at which the
95-
.Sy diagnostic report
96-
will be generated.
97-
.
98-
.It Fl -diagnostic-report-filename
99-
Name of the file to which the
100-
.Sy diagnostic report
101-
will be written.
102-
.
103-
.It Fl -diagnostic-report-on-fatalerror
104-
Enables the
105-
.Sy diagnostic report
106-
to be triggered on fatal errors (internal errors within the Node.js runtime such as out of memory) that leads to termination of the application, if
107-
.Sy --experimental-report
108-
is enabled. Useful to inspect various diagnostic data elements such as heap, stack, event loop state, resource consumption etc. to reason about the fatal error.
109-
.
110-
.It Fl -diagnostic-report-on-signal
111-
Enables
112-
.Sy diagnostic report
113-
to be generated upon receiving the specified (or predefined) signal to the running Node.js process, if
114-
.Sy --experimental-report
115-
is enabled. Default signal is SIGUSR2.
116-
.
117-
.It Fl -diagnostic-report-signal
118-
Sets or resets the signal for
119-
.Sy diagnostic report
120-
generation (not supported on Windows). Default signal is SIGUSR2.
121-
.
122-
.It Fl -diagnostic-report-uncaught-exception
123-
Enables
124-
.Sy diagnostic report
125-
to be generated on un-caught exceptions, if
126-
.Sy --experimental-report
127-
is enabled. Useful when inspecting JavaScript stack in conjunction with native stack and other runtime environment data.
128-
.
12993
.It Fl -enable-fips
13094
Enable FIPS-compliant crypto at startup.
13195
Requires Node.js to be built with
@@ -250,6 +214,42 @@ Write process warnings to the given
250214
.Ar file
251215
instead of printing to stderr.
252216
.
217+
.It Fl -report-directory
218+
Location at which the
219+
.Sy diagnostic report
220+
will be generated.
221+
.
222+
.It Fl -report-filename
223+
Name of the file to which the
224+
.Sy diagnostic report
225+
will be written.
226+
.
227+
.It Fl -report-on-fatalerror
228+
Enables the
229+
.Sy diagnostic report
230+
to be triggered on fatal errors (internal errors within the Node.js runtime such as out of memory) that leads to termination of the application, if
231+
.Sy --experimental-report
232+
is enabled. Useful to inspect various diagnostic data elements such as heap, stack, event loop state, resource consumption etc. to reason about the fatal error.
233+
.
234+
.It Fl -report-on-signal
235+
Enables
236+
.Sy diagnostic report
237+
to be generated upon receiving the specified (or predefined) signal to the running Node.js process, if
238+
.Sy --experimental-report
239+
is enabled. Default signal is SIGUSR2.
240+
.
241+
.It Fl -report-signal
242+
Sets or resets the signal for
243+
.Sy diagnostic report
244+
generation (not supported on Windows). Default signal is SIGUSR2.
245+
.
246+
.It Fl -report-uncaught-exception
247+
Enables
248+
.Sy diagnostic report
249+
to be generated on un-caught exceptions, if
250+
.Sy --experimental-report
251+
is enabled. Useful when inspecting JavaScript stack in conjunction with native stack and other runtime environment data.
252+
.
253253
.It Fl -throw-deprecation
254254
Throw errors for deprecations.
255255
.

0 commit comments

Comments
 (0)
Please sign in to comment.