cologger

Colorful, simple, customizable logger

npm install cologger
8 downloads in the last week
14 downloads in the last month

cologger

Colorful, simple node.js logger

usage

require

var logger = require('cologger');

settings

logger.showDebug = true;

If you set the property to false or don't specify it, debug-messages won't show.

existing log levels

// [INFO] in white
logger.info('info-message');

// [DEBUG] in cyan
logger.debug('debug-message');

// [SUCCESS] in green
logger.success('success-message');

// [WARN] in yellow
logger.warn('warn-message');

// [ERROR] in red
logger.error('error-message');

log objects

// Log objects
logger.success('Successfully created an object', { my: 'object' }, true, undefined, null, [1,2,4]);

custom log levels

logger.addLevel('custom', 'magenta');

// [CUSTOM] in magenta
logger.custom('ugly log');

logger.removeLevel('custom');
available colors
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
npm loves you