0.0.2 • Published 6 years ago

nimble-error-manager v0.0.2

Weekly downloads
5
License
-
Repository
-
Last release
6 years ago

Nimble Error Manager

A library that logs errors, warnings or logs to the console and optionally emails the message

Installation

npm install @jason.hirst/nimble-error-manager

Usage

/* These must be set in environment variables */
NIMBLE_SENDGRID_KEY
NIMBLE_SENDGRID_EMAIL_FROM
NIMBLE_SENDGRID_EMAIL_TO

var errorManager = require('@jason.hirst/nimble-error-manager');

/* Log (to console currently) without sending email */        
errorManager.reportLog('some message');

/* Debug (to console currently) without sending email */        
errorManager.reportDebug('some message');

/* Error (to console currently) without sending email */        
errorManager.reportError('some message');

/* Log (to console currently) and email */        
errorManager.reportLog('some message', true);

/* Debug (to console currently) and email */        
errorManager.reportDebug('some message', true);

/* Error (to console currently) and email */        
errorManager.reportError('some message', true);

Tests

Contributing

Feel free to improve on this most basic of modules. Logging to console can of course be replaced with an alternative.