uLogger
Tiny logger utility for Node.JS and the browser
Usage
var logger = 'my-unit'; logger;logger;
Enable/disable
In your app code, you can enable/disable the logger at any moment:
var logger = logger; // ... logger;
On Node.JS, you can start your app with an environment flag:
DEBUG=1 node my-app.js
Same goes for a web app, but in the window
object:
windowDEBUG=1;
Log levels
You can adjust the logging level from error to debug. The log whose values are higher than the level won't be printed.
// 0 = error// 1 = warn// 2 = info// 3 = log// 4 = debug var level = 2;logger; // only error, warn and info logs will be printed from now on
Happy debugging!