jslogger

JSLogger library

npm install jslogger
6 downloads in the last week
23 downloads in the last month

jslogger-node

Build Status

NodeJS module for JSLogger

Installation

$ npm install jslogger

Documentation

Instatiate a logger with your secret API key. You can get your key on http://jslogger.com/manage/#code.

var logger = require("jslogger")({key: "SECRET_KEY"});

Log an error string

logger.log("I'm an error! Log me!");

Log an error object

logger.log({auth: {error: "Sign up failed...", reason: "Bad credentials."}});

Log an event string

logger.event("We got a new signup!");

Log an event object

logger.event({auth: {action: "Sign up", username: "doomhz"}});

You can set the track to false in development or testing mode

var track = process.env.NODE_ENV === "production" ? true : false;
var logger2 = require("jslogger")({key: "SECRET_KEY", track: track});

The remote request will not be executed when track option is false

logger2.log("Non trackable error in dev mode");
logger2.event("Non trackable event in dev mode");
npm loves you