Created
November 3, 2013 22:48
-
-
Save bendangelo/7295767 to your computer and use it in GitHub Desktop.
Log and assert wrappers.
This file contains hidden or 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
| function LOG() { | |
| if (window.DEBUG_MODE) try { | |
| console.log.apply(console, arguments); | |
| } catch (e) {} | |
| } | |
| function ASSERT(condition, message) { | |
| if (!condition) { | |
| if(console && typeof console.assert == "function"){ | |
| console.assert(condition, message); | |
| } else { | |
| throw "Failed assert: " + message; | |
| } | |
| } | |
| return condition; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment