Very small console logger module
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
package.json
test.js
tinylogger.js

README.md

#tinylogger.js

A very simple node module for console logging with colors.

console

##Install:

npm install tinylogger

##Usage:

var log = require('tinylogger');

log.error('Something wrong'); // displays an error message
log.info('This is a message'); // info message
log.debug('I am here!'); // debug message

log.options.level = LOG_ALL; // display all messages
log.options.level = LOG_NONE; // disable logging
log.options.level = LOG_DEBUG; // display only debug messages
log.options.level = LOG_DEBUG+LOG_ERROR; // display debug and error messages

##Default message types:

trace, debug, info, warn, alert, error, panic, text, todo, ok, sql

##Requires:

###Colors:

npm install colors

Or you can disable colors:

log.options.colors = false;
log.applyOptions();

##Customize:

You can add new message types or modify the existing ones, just look at options.levels array.