0.5.0 • Published 9 years ago

lg v0.5.0

Weekly downloads
2
License
-
Repository
-
Last release
9 years ago

lg

is a super simple logger class for nodeJS. It's part of the VisualWeb Framework (currently not public). it will log to the console, a (mongoDB) database, a file. just pass the configuration options when instantiating a new logger and there you go.

	Logger = require('logger');

	var log = new Logger(
		{
			log2console:true,
			rules: {
				minLogLevel: function(config, logTarget, content, sender, logLevel) {
					if (logLevel < 2) return false;
					return true;
				}
			}
		}, 
		function(loggerInstance) { 
			// if you chose log2database, you will need to wait for the
			// callback to be able to actually log... 
		} 
	);

	log.add('this is a message', 'cyan', 'byTest', 2);

Loglevels:

error (1):

	myLogger.error('Test ERROR message.', 'red', 'examples');

warn (2):

	myLogger.warn('Test WARN message.', 'yellow', 'examples');

info (3):

	myLogger.info('Test INFO message.', 'green', 'examples');

debug (4):

	myLogger.debug('Test DEBUG message.', 'blink', 'examples');

trace (5):

	myLogger.trace('Test TRACE message.', 'white', 'examples');

If you are not sure how to use these loglevels, here is a nice description.

0.5.0

9 years ago

0.4.9

9 years ago

0.4.8

10 years ago

0.4.7

10 years ago

0.4.6

10 years ago

0.4.5

10 years ago

0.4.4

10 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.5.1

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.5

11 years ago

0.2.4

11 years ago

0.2.3

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago