0.1.2 • Published 10 years ago

node_logger v0.1.2

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

Node Logger - Making debugging in the console a tiny bit easier.

Installation

npm install node_logger

Usage

var logger = require('node_logger');

var obj = {
  'prop1': 'value',
  'prop2': [1,2,3,4],
  'prop3': function() { console.log('test') }
}

//All of the following will print a nicely formatted JSON or Javascript object. Useful
//as replacement for util.inspect() or console.log().
logger.log(obj);
logger.prettyPrint(obj);
logger.pp(obj);


//These will print regular string messages with colors.
var msg = 'A log line';

logger.success(msg); //green
logger.error(msg); //red
logger.warn(msg); //yellow
logger.info(msg); //cyan

##Config

You can call logger.configure() with a settings object or key, value pair to change logger options.

Example:

logger.configure({ showTimestamp: true}); //or
logger.configure('showTimestamp', true);

Options:

  • timestampShow: true|false // default: true. Will display a timestamp next to messages.
  • timestampFormat: "string" // default: 'MMM DD YYYY, HH:mm:ss'. Any format string that moment.js can process.

Author

Stanislav Venzerul @ckm2k1

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago