Log things, prefixed with a timestamp and level. Choose what to log, based on verbosity level.
npm install fancy-log-levels[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]
Log things, prefixed with a timestamp and level. Choose what to log, based on verbosity level.
``js
var log = require('fancy-log-levels');
log(3)
log.debug('a message');
// [16:27:02] [D] a message
log.error('oh no!');
// [16:27:02] [E] oh no!
`
Sets the debug level.
- -1 is mute
- 0 is error and user-info
- 1 is warning
- 2 is info
- 3 is debug
Logs the message as if you called console.log but prefixes the output with the[D]
current time in HH:MM:ss format and .
Logs the message as if you called console.error but prefixes the output with the[E]
current time in HH:MM:ss format and .
Logs the message as if you called console.warn but prefixes the output with the[W]
current time in HH:MM:ss format and .
Logs the message as if you called console.info but prefixes the output with the[I]
current time in HH:MM:ss format and .
Logs the message as if you called console.info but prefixes the output with the[I]
current time in HH:MM:ss format and .
Logs the message as if you called console.dir but prefixes the output with the[D]`.
current time in HH:MM:ss format and
MIT
[downloads-image]: http://img.shields.io/npm/dm/fancy-log-levels.svg
[npm-url]: https://www.npmjs.com/package/fancy-log-levels
[npm-image]: http://img.shields.io/npm/v/fancy-log-levels.svg