logger-simple v1.0.4
loggerJS
console log in formal way for complex javascript applications
Usage
npm install logger-simple
var LoggerJS = require("logger-simple");
create a object as global in the js file
var log_ = new LoggerJS.LoggerJS('#custom profile name');
now console your message using the functions:
log.info('#message'); log.info('#message',#data); log.info('#data'); log.info('#message',#data,'#functionName');
log.error('#message'); log.error('#message',#data); log.error('#data'); log.error('#message',#data,'#functionName');
log.debug('#message'); log.debug('#message',#data); log.debug(#data); log.debug('#message',#data,'#functionName')
The message ,function and custom profile name is expected as string.
The data can be anything array,object,...
if used "use strict" then the function name cannot be acquired , you have to provide it as third parameter explictly.
The way the logging is done:
INFO 2011-10-05T14:48:00.000Z PAYLOAD {"sample":"test"}
DEBUG 2011-10-05T14:48:00.000Z PAYLOAD {"sample":"test"}
ERROR 2011-10-05T14:48:00.000Z PAYLOAD {"sample":"test"}