Colorful, simple, customizable node.js logger
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
logger.js
package.json

README.md

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