strulo
Log messages in a structured format
Install
using NPM
npm install --save strulo
How to use it
const logger = require('strulo')
logger.debug('hello')
logger.info('hello from strulo')
logger.error('some error')
The DEBUG environment variable is used to enable these based on space or comma-delimited names. Here are some examples:
export DEBUG=DEBUG,ERROR,ALERT
displays only log messages with log level debug, error and alert
DEBUG {"message":"hello","level":"100","level_name":"DEBUG","time":1506502514498} +0ms
ERROR {"message":"some error","level":"400","level_name":"ERROR","time":1506502554430} +40s