Skip to content

Instantly share code, notes, and snippets.

@radius
Created February 10, 2012 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radius/1785509 to your computer and use it in GitHub Desktop.
Save radius/1785509 to your computer and use it in GitHub Desktop.
Little JS logger class
var Logger = (function() {
return {
active: true,
post: false,
log: function(obj, type) {
if(Logger.active) {
console.log(obj);
}
if(Logger.post) {
$.post(Logger.post, {
"log": {
"type": type,
"message": obj
}
});
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment