https://github.com/softonic/log-uncaught-exceptions
Logs uncaught process exceptions to a given logger
https://github.com/softonic/log-uncaught-exceptions
Last synced: 9 months ago
JSON representation
Logs uncaught process exceptions to a given logger
- Host: GitHub
- URL: https://github.com/softonic/log-uncaught-exceptions
- Owner: softonic
- License: other
- Created: 2016-11-13T12:07:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T11:59:25.000Z (over 6 years ago)
- Last Synced: 2025-08-09T10:14:09.490Z (10 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 21
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# log-uncaught-exceptions
Logs uncaught process exceptions to the given logger (ideally a [Bunyan](https://github.com/trentm/node-bunyan) logger but works with any object with a `fatal` method).
## Installation
```bash
npm install log-uncaught-exceptions
```
## Usage
```js
// CommonJS
// const logUncaughtExceptions = require('log-uncaught-exceptions');
// ES6
import logUncaughtExceptions from 'log-uncaught-exceptions/es';
import bunyan from 'bunyan';
const logger = bunyan.createLogger({ name: "myapp" });
logUncaughtExceptions({ logger });
```
## Testing
Clone the repository and execute:
```bash
npm test
```
## Contribute
1. Fork it: `git clone https://github.com/softonic/log-uncaught-exceptions.git`
2. Create your feature branch: `git checkout -b feature/my-new-feature`
3. Commit your changes: `git commit -am 'Added some feature'`
4. Check the build: `npm run build`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D