Created
February 10, 2012 02:08
-
-
Save radius/1785509 to your computer and use it in GitHub Desktop.
Little JS logger class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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