node log utility, only for terminal output
npm i --save log-util
var log = require('log-util');
log.verbose('verbose', 0);
log.debug('debug', 1);
log.info('info', 2);
log.warn('warn', 3);
log.error('error', 4);
new Log(level, dateFormat)
level
is level id or level string
containing level corresponding
levelArray = [
{
level: 0,
string: 'verbose',
color: 'gray'
},
{
level: 1,
string: 'debug',
color: 'green'
},
{
level: 2,
string: 'info',
color: 'cyan'
},
{
level: 3,
string: 'warn',
color: 'yellow'
},
{
level: 4,
string: 'error',
color: 'red'
}
]
log.Log.VERBOSE === 0;
log.Log.DEBUG === 1;
log.Log.INFO === 2;
log.Log.WARN === 3;
log.Log.ERROR === 4;