Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (15 sloc) 916 Bytes
Simple Logger
How to use
npm install lognj
var doct=require('lognj');
var l=doct.getLogger('filelog','/tmp/log/'); //if you want to log into a file
var l=doct.getLogger('dblog','mydb','log'); // log into db...currently only mongodb is supported 'mydb' is database name and 'log' is collection name
var l=doct.getLogger('socketlog','');
and the codes on the other server side should be
socket.on('debug', function (data) {console.log( ;});
socket.on('error', function (data) {console.log( ;});
socket.on('info', function (data) {console.log( ;});
socket.on('warn', function (data) {console.log( ;}); is the log msg you have send through the socket
var l=doc.getLogger(); //do nothing log into command line
it has debug(logmsg) error(logmsg) info(logmsg) warn(logmsg) trunOffDebug() turnOffInfo() turnOffWarnning() methods