node-log-simple
v1.0.2
Published
Simple level based logging library
Downloads
3
Maintainers
Readme
node-log-simple
A simple Node.js level based logging library
Usage
Import
const log = require('node-log-simple')
Usage
Set Level
log.setLevel(log.levels.TRACE)
Log
log.trace('foo')
log.debug('foo')
log.info('foo')
log.warn('foo')
log.error('foo')
log.fatal('foo')
Example Output
2020-02-03T16:49:05.462Z [TRACE] foo
2020-02-03T16:49:05.469Z [DEBUG] foo
2020-02-03T16:49:05.469Z [INFO] foo
2020-02-03T16:49:05.469Z [WARN] foo
2020-02-03T16:49:05.469Z [ERROR] foo
2020-02-03T16:49:05.471Z [FATAL] foo
Available levels
TRACE
: Logs to stdoutDEBUG
: Logs to stdoutINFO
: Logs to stdout (default value)WARN
: Logs to stdoutERROR
: Logs to stderrFATAL
: Logs to stderr then exits process