Skip to content

Commit 88019b0

Browse files
cjihrigtargos
authored andcommitted
report: rename setDiagnosticReportOptions()
setDiagnosticReportOptions() is a method on process.report, making the "DiagnosticReport" part redundant. Rename the function to setOptions(). PR-URL: #25990 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent c8ceece commit 88019b0

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

doc/api/process.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ console.log(data);
16871687

16881688
Additional documentation is available in the [report documentation][].
16891689

1690-
### process.report.setDiagnosticReportOptions([options]);
1690+
### process.report.setOptions([options]);
16911691
<!-- YAML
16921692
added: v11.8.0
16931693
-->
@@ -1712,23 +1712,18 @@ are shown below.
17121712

17131713
```js
17141714
// Trigger a report on uncaught exceptions or fatal errors.
1715-
process.report.setDiagnosticReportOptions({
1716-
events: ['exception', 'fatalerror']
1717-
});
1715+
process.report.setOptions({ events: ['exception', 'fatalerror'] });
17181716

17191717
// Change the default path and filename of the report.
1720-
process.report.setDiagnosticReportOptions({
1721-
filename: 'foo.json',
1722-
path: '/home'
1723-
});
1718+
process.report.setOptions({ filename: 'foo.json', path: '/home' });
17241719

17251720
// Produce the report onto stdout, when generated. Special meaning is attached
17261721
// to `stdout` and `stderr`. Usage of these will result in report being written
17271722
// to the associated standard streams. URLs are not supported.
1728-
process.report.setDiagnosticReportOptions({ filename: 'stdout' });
1723+
process.report.setOptions({ filename: 'stdout' });
17291724

17301725
// Enable verbose option on report generation.
1731-
process.report.setDiagnosticReportOptions({ verbose: true });
1726+
process.report.setOptions({ verbose: true });
17321727
```
17331728

17341729
Signal based report generation is not supported on Windows.
@@ -1742,8 +1737,8 @@ added: v11.8.0
17421737

17431738
* `filename` {string} Name of the file where the report is written. This
17441739
should be a relative path, that will be appended to the directory specified in
1745-
`process.report.setDiagnosticReportOptions`, or the current working directory
1746-
of the Node.js process, if unspecified.
1740+
`process.report.setOptions`, or the current working directory of the Node.js
1741+
process, if unspecified.
17471742
* `err` {Error} A custom error used for reporting the JavsScript stack.
17481743

17491744
* Returns: {string} Returns the filename of the generated report.

doc/api/report.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,10 @@ times for the same Node.js process.
445445
## Configuration
446446

447447
Additional runtime configuration that influences the report generation
448-
constraints are available using `setDiagnosticReportOptions()` API.
448+
constraints are available using `setOptions()` API.
449449

450450
```js
451-
process.report.setDiagnosticReportOptions({
451+
process.report.setOptions({
452452
events: ['exception', 'fatalerror', 'signal'],
453453
signal: 'SIGUSR2',
454454
filename: 'myreport.json',
@@ -481,13 +481,13 @@ pertinent to the report generation. Defaults to `false`.
481481

482482
```js
483483
// Trigger report only on uncaught exceptions.
484-
process.report.setDiagnosticReportOptions({ events: ['exception'] });
484+
process.report.setOptions({ events: ['exception'] });
485485

486486
// Trigger report for both internal errors as well as external signal.
487-
process.report.setDiagnosticReportOptions({ events: ['fatalerror', 'signal'] });
487+
process.report.setOptions({ events: ['fatalerror', 'signal'] });
488488

489489
// Change the default signal to `SIGQUIT` and enable it.
490-
process.report.setDiagnosticReportOptions(
490+
process.report.setOptions(
491491
{ events: ['signal'], signal: 'SIGQUIT' });
492492
```
493493

lib/internal/process/report.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let config = {
2929
verbose: false
3030
};
3131
const report = {
32-
setDiagnosticReportOptions(options) {
32+
setOptions(options) {
3333
emitExperimentalWarning('report');
3434
const previousConfig = config;
3535
const newConfig = {};

0 commit comments

Comments
 (0)