All Projects → ehmicky → Log Process Errors

ehmicky / Log Process Errors

Licence: apache-2.0
Show some ❤️ to Node.js process errors

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects

Projects that are alternatives of or similar to Log Process Errors

koa-better-error-handler
A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)
Stars: ✭ 51 (-87.97%)
Mutual labels:  handler, error-handler, error-handling, error
Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (-88.68%)
Mutual labels:  error-handling, error-handler, debugging, error
Test Each
🤖 Repeat tests. Repeat tests. Repeat tests.
Stars: ✭ 89 (-79.01%)
Mutual labels:  library, test, code-quality
Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (+20.05%)
Mutual labels:  error-handling, logging, debugging
Thoth
An Error Logger for Go
Stars: ✭ 22 (-94.81%)
Mutual labels:  error-handling, logging, error
Vlog
An in-display logging library for Android 📲
Stars: ✭ 86 (-79.72%)
Mutual labels:  library, logging, debugging
Golib
Go Library [DEPRECATED]
Stars: ✭ 194 (-54.25%)
Mutual labels:  library, monitoring, logging
Human Signals
Human-friendly process signals
Stars: ✭ 223 (-47.41%)
Mutual labels:  error-handling, process, error
Emperror
The Emperor takes care of all errors personally
Stars: ✭ 201 (-52.59%)
Mutual labels:  error-handling, error-handler, error
Swift Error Handler
Error handling library for Swift
Stars: ✭ 172 (-59.43%)
Mutual labels:  error-handling, error-handler, error
Exceptionless
Exceptionless server and jobs
Stars: ✭ 2,107 (+396.93%)
Mutual labels:  error-handling, monitoring, logging
Await Handler
Basic wrapper for await that allows handling of errors without try/catch blocks
Stars: ✭ 13 (-96.93%)
Mutual labels:  promise, error-handling, handler
TrackJS-Node
TrackJS Error Monitoring agent for NodeJS
Stars: ✭ 26 (-93.87%)
Mutual labels:  debugging, error-handling, error
Sysmon Config
Sysmon configuration file template with default high-quality event tracing
Stars: ✭ 3,287 (+675.24%)
Mutual labels:  monitoring, logging
Pygogo
A Python logging library with superpowers
Stars: ✭ 265 (-37.5%)
Mutual labels:  library, logging
Stern
⎈ Multi pod and container log tailing for Kubernetes -- Friendly fork of https://github.com/wercker/stern
Stars: ✭ 268 (-36.79%)
Mutual labels:  logging, debugging
Tensorwatch
Debugging, monitoring and visualization for Python Machine Learning and Data Science
Stars: ✭ 3,191 (+652.59%)
Mutual labels:  monitoring, debugging
graceful
Gracefully exit server (Koa), database (Mongo/Mongoose), Redis clients, and job scheduler (Redis/Bull)
Stars: ✭ 37 (-91.27%)
Mutual labels:  handler, process
Tiny Process Library
A small platform independent library making it simple to create and stop new processes in C++, as well as writing to stdin and reading from stdout and stderr of a new process
Stars: ✭ 276 (-34.91%)
Mutual labels:  library, process
Analog
PHP logging library that is highly extendable and simple to use.
Stars: ✭ 314 (-25.94%)
Mutual labels:  monitoring, logging

Codecov Build Node Twitter Medium

📰 Medium article.

Show some ❤️ to Node.js process errors.

Node.js prints process errors (uncaughtException, warning, unhandledRejection, rejectionHandled) on the console which is very useful. Unfortunately those errors:

log-process-errors fixes all those issues.

Without log-process-errors:

Screenshot before

With log-process-errors:

Screenshot after

Use cases

  • Proper logging of process errors in production.
  • Debugging of process errors in development.
  • Automated testing of process errors.

Demo

You can try this library:

Install

Production code (e.g. a server) can install this either as a production or development dependency:

npm install log-process-errors

However, libraries should install this as a development dependency:

npm install -D log-process-errors

This is because logging is modified globally and libraries users might not expect this side-effect. Also, this might lead to conflicts between libraries.

Usage

There are two ways to load this library. The first is to use the node -r CLI flag:

node -r log-process-errors/build/register ...

The second is:

const logProcessErrors = require('log-process-errors')
logProcessErrors(options)

logProcessErrors() should be called as early as possible in the code, before other require/import statements.

Options

options is an optional object with the following properties.

log

Type: function(error, level, originalError)

Customizes how process errors are logged.
Full documentation.

level

Type: object
Default: { warning: 'warn', multipleResolves: 'info', default: 'error' }

Which log level to use.
Full documentation.

exitOn

Type: string[]
Default: ['uncaughtException', 'unhandledRejection'] for Node >= 15.0.0, ['uncaughtException'] otherwise.

Which process errors should trigger process.exit(1).
Full documentation.

testing

Type: string
Value: 'ava', 'mocha', 'jasmine', 'tape' or 'node-tap'
Default: undefined

When running tests, makes them fail if there are any process errors.
Full documentation.

colors

Type: boolean
Default: true if the output is a terminal.

Colorizes messages.
Full documentation.

Support

For any question, don't hesitate to submit an issue on GitHub.

Everyone is welcome regardless of personal background. We enforce a Code of conduct in order to promote a positive and inclusive environment.

Contributing

This project was made with ❤️. The simplest way to give back is by starring and sharing it online.

If the documentation is unclear or has a typo, please click on the page's Edit button (pencil icon) and suggest a correction.

If you would like to help us fix a bug or add a new feature, please check our guidelines. Pull requests are welcome!

Thanks go to our wonderful contributors:

🎨 🤔 📖 💬
Hongarc

📖 💻

Andy Brenneke

🐛
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].