sutra
Minimalistic streaming logger with layered transport and custom field support.
Uses the same output format as bole, so tools like bistre and garnish will work great.
Installation
npm i sutra
Example
let log = // application logginglet app = // direct everything to a papertrail streamapp // direct error & fatal levels to process.stderrapperrorappfatal // postgres service logginglet postgres = // log the postgres debug & info events to stdoutpostgresdebugpostgresinfo let query = 'SELECT * FROM teams'let client = // add custom fieldspostgresdebug // log out with printf supportpostgres
Levels
- trace: finer-grained informational events than the debug
- debug: fine-grained informational events that are most useful to debug an application
- info: informational messages that highlight the progress of the application at coarse-grained level
- warn: potentially harmful situations
- error: error events that might still allow the application to continue running.
- fatal: very severe error events that will presumably lead the application to abort.
Tests
npm install
npm test
License
MIT