0.0.5 • Published 12 years ago

lognj v0.0.5

Weekly downloads
26
License
-
Repository
github
Last release
12 years ago

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','16.186.7.38:3000'); and the codes on the other server side should be socket.on('debug', function (data) {console.log(data.data) ;}); socket.on('error', function (data) {console.log(data.data) ;}); socket.on('info', function (data) {console.log(data.data) ;}); socket.on('warn', function (data) {console.log(data.data) ;});

data.data 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

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago