logged
Logging should be simple. This library is 80 lines of code. It gets the job done. Simply.
examples
simple
var log = ;log;
What you should see on stderr: {"level":0,"message":"test","date":"2012-04-21T09:37:47.373Z"}
named logger
var log = 'my-logger';log;
What you should see on stderr: {"level":0,"message":"test","name":"my-logger","date":"2012-04-21T09:37:47.373Z"}
log with more context
var log = name: 'my-logger' env: 'production';log;
What you should see on stderr: {"level":0,"message":"test","name":"my-logger","date":"2012-04-21T09:37:47.373Z","env":"production","user":"joe"}
customizable
change the log levels
//before requiring anything else from loggedvar levels = ;levelstrace = 0;levelsdebug = 1;levelsawesome = 2;levelschainsaw = 3;levelsboom = 4; var log = ;log;log;
change how the log is output
var logged = ;//if you handle the log event yourself//logged will do no outputting to stderr//this lets you effectively do anything you want//with the log messageslogged;