0.1.5 • Published 8 years ago

better-logger v0.1.5

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

better-logger

A small node module providing an advanced logger interface with colors and date. As easy to use as the default Console class.

Installation

npm install better-logger --save

Usage

var Log = require('better-logger');
	
Log.info('info');
Log.warn('warn');
Log.error('error');

Log.enableDebug();
Log.debug('debug');

// This is an example
var obj = {foo: ['bar'], baz: undefined, qux: {a: 'b', c: 'd'}} 
Log.dir(obj);

Log.space();
Log.separator();

Styles

I used colors to set the color and dateformat for the date.

enableDebug(status:Boolean)

Enable (or disable) debug output. If status is undefined, debug output will be enabled.

setPrefix(type:String, newPrefix:String)

Set the prefix of a log function. Type can be one of these : info / error / warn / debug

setSeparator(newSeparator:String)

Set the separator for the separator() method.

setDateFormat(newFormat:String, newColor:String)

Set the date format for dateformat. If newColor is specified, the date color is set to the newColor. (otherwise ignored) Colors list: colors

Release History

  • 0.1.0 Initial release
0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago