lillog
v1.0.7
Published
Simple UDP Based logging lib
Downloads
4
Readme
lillog
Smallest possible logger available
Straight to the point:
var lillog = require('lillog');
//Std logging
lillog.log('teste');
//Error logging
lillog.error(new Error('I am a fake error'));
//Debug logging
lillog.debug('debug');
//Logs the trace where called to console
lillog.trace('teste trace');
lillog has a config object, that allows changing logging behavior without recoding:
lillog.config = {
//time format for messages - see momentjs
timeformat: 'YYYY-MM-DD HH:mm:ss',
//enable debug msgs
debugenabled: true,
//enable log msgs
logenabled: true,
//enable error msgs
errorenabled: true,
//enable error stack print
errorprinttrace: true,
//enable trace
traceenabled: true
};
IMPORTANT:
At the moment everything goes to console (It is intended that system will handle this properly - pm2 for example will handle logs better than this.) This is intended to be organize logging from app coding perspective only.