@@ -1669,6 +1669,21 @@ added: v11.8.0
1669
1669
reports for the current process. Additional documentation is available in the
1670
1670
[ report documentation] [ ] .
1671
1671
1672
+ ## process.report.directory
1673
+ <!-- YAML
1674
+ added: REPLACEME
1675
+ -->
1676
+
1677
+ * {string}
1678
+
1679
+ Directory where the report is written. The default value is the empty string,
1680
+ indicating that reports are written to the current working directory of the
1681
+ Node.js process.
1682
+
1683
+ ``` js
1684
+ console .log (` Report directory is ${ process .report .directory } ` );
1685
+ ```
1686
+
1672
1687
### process.report.getReport([ err] )
1673
1688
<!-- YAML
1674
1689
added: v11.8.0
@@ -1687,43 +1702,75 @@ console.log(data);
1687
1702
1688
1703
Additional documentation is available in the [ report documentation] [ ] .
1689
1704
1690
- ### process.report.setOptions( [ options ] );
1705
+ ## process.report.filename
1691
1706
<!-- YAML
1692
- added: v11.8.0
1707
+ added: REPLACEME
1693
1708
-->
1694
1709
1695
- * ` options ` {Object}
1696
- * ` events ` {string[ ] }
1697
- * ` signal ` : Generate a report in response to a signal raised on the process.
1698
- * ` exception ` : Generate a report on unhandled exceptions.
1699
- * ` fatalerror ` : Generate a report on internal fault
1700
- (such as out of memory errors or native assertions).
1701
- * ` signal ` {string} Sets or resets the signal for report generation
1702
- (not supported on Windows). ** Default:** ` 'SIGUSR2' ` .
1703
- * ` filename ` {string} Name of the file where the report is written.
1704
- * ` path ` {string} Directory where the report is written.
1705
- ** Default:** the current working directory of the Node.js process.
1710
+ * {string}
1706
1711
1707
- Configures the diagnostic reporting behavior. Upon invocation , the runtime
1708
- is reconfigured to generate reports based on ` options ` . Several usage examples
1709
- are shown below .
1712
+ Filename where the report is written. If set to the empty string , the output
1713
+ filename will be comprised of a timestamp, PID, and sequence number. The default
1714
+ value is the empty string .
1710
1715
1711
1716
``` js
1712
- // Trigger a report on uncaught exceptions or fatal errors.
1713
- process .report .setOptions ({ events: [' exception' , ' fatalerror' ] });
1717
+ console .log (` Report filename is ${ process .report .filename } ` );
1718
+ ```
1719
+
1720
+ ## process.report.reportOnFatalError
1721
+ <!-- YAML
1722
+ added: REPLACEME
1723
+ -->
1724
+
1725
+ * {boolean}
1714
1726
1715
- // Change the default path and filename of the report.
1716
- process . report . setOptions ({ filename : ' foo.json ' , path : ' /home ' });
1727
+ If ` true ` , a diagnostic report is generated on fatal errors, such as out of
1728
+ memory errors or failed C++ assertions.
1717
1729
1718
- // Produce the report onto stdout, when generated. Special meaning is attached
1719
- // to `stdout` and `stderr`. Usage of these will result in report being written
1720
- // to the associated standard streams. URLs are not supported.
1721
- process .report .setOptions ({ filename: ' stdout' });
1730
+ ``` js
1731
+ console .log (` Report on fatal error: ${ process .report .reportOnFatalError } ` );
1722
1732
```
1723
1733
1724
- Signal based report generation is not supported on Windows.
1734
+ ## process.report.reportOnSignal
1735
+ <!-- YAML
1736
+ added: REPLACEME
1737
+ -->
1725
1738
1726
- Additional documentation is available in the [ report documentation] [ ] .
1739
+ * {boolean}
1740
+
1741
+ If ` true ` , a diagnostic report is generated when the process receives the
1742
+ signal specified by ` process.report.signal ` .
1743
+
1744
+ ``` js
1745
+ console .log (` Report on signal: ${ process .report .reportOnSignal } ` );
1746
+ ```
1747
+
1748
+ ## process.report.reportOnUncaughtException
1749
+ <!-- YAML
1750
+ added: REPLACEME
1751
+ -->
1752
+
1753
+ * {boolean}
1754
+
1755
+ If ` true ` , a diagnostic report is generated on uncaught exception.
1756
+
1757
+ ``` js
1758
+ console .log (` Report on exception: ${ process .report .reportOnUncaughtException } ` );
1759
+ ```
1760
+
1761
+ ## process.report.signal
1762
+ <!-- YAML
1763
+ added: REPLACEME
1764
+ -->
1765
+
1766
+ * {string}
1767
+
1768
+ The signal used to trigger the creation of a diagnostic report. Defaults to
1769
+ ` SIGUSR2 ` .
1770
+
1771
+ ``` js
1772
+ console .log (` Report signal: ${ process .report .signal } ` );
1773
+ ```
1727
1774
1728
1775
### process.report.triggerReport([ filename] [ , err ] )
1729
1776
<!-- YAML
@@ -1732,7 +1779,7 @@ added: v11.8.0
1732
1779
1733
1780
* ` filename ` {string} Name of the file where the report is written. This
1734
1781
should be a relative path, that will be appended to the directory specified in
1735
- ` process.report.setOptions ` , or the current working directory of the Node.js
1782
+ ` process.report.directory ` , or the current working directory of the Node.js
1736
1783
process, if unspecified.
1737
1784
* ` err ` {Error} A custom error used for reporting the JavaScript stack.
1738
1785
0 commit comments