basic-logger

basic logger supporting error, warning, debug and info messages with timestamp.

logger

Basic logger for nodejs supporting error, warning, debug and info messages with timestamp. Everything you log is printed to the console.

npm install logger
var logger = require('logger');

var customConfig = {
    showMillis: true;
    stringifyJSON: false;
};

var log = new logger(customConfig)

log.info('New Info!');
log.error('An error occurred');
log.warn('I am not kidding!');
log.debug('this code is still alive...');
  • showMillis - Show the milliseconds in the timestamp
  • stringifyJSON - Apply JSON.stringify to the given message. Good to log objects or arrays.

You'll need vows. Then just run npm test.

I am willing to add support for colored log messages and allow to define a prefix which is prepended to all messages.