Report important environmental information when an error occurs or a process crashes.
Sometimes an application or script fails. Sometimes we want to write an error log with environmental information about the failure. Boost supports this exact scenario.
Take advantage of crash reporting by importing and instantiating the
The reporter supports a collection of chainable methods that log targeted information, grouped into
sections. The following methods are available on
reportBinaries()- Reports binary versions and paths for Node, NPM, and Yarn.
reportEnvVars()- Sorts and reports all environment variables.
reportLanguages()- Reports versions and paths for common programming languages, like Java, Python, Ruby, and more.
reportPackageVersions()- Report NPM package versions for all that match the defined pattern(s).
reportProcess()- Reports information about the currently running process.
reportStackTrace(error: Error)- Reports the stack trace for the provided
reportSystem()- Reports information about the system, OS, and platform.
If you'd like to add your own section and label value pairs, use
requires a title, and
CrashReporter#add(), which accepts a label and one or many values.
Once all the information has been buffered, we can write the content to a log file by using
CrashReporter#write(), which requires an absolute file path.