Skip to content
npm modules
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


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
Something went wrong with that request. Please try again.