Last active
September 4, 2015 00:55
-
-
Save bofrede/238661 to your computer and use it in GitHub Desktop.
Debug function that works on all browsers.
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
function debug(aMsg) { | |
if (window.console) { | |
window.console.log(aMsg); | |
} else if (window.dump) { | |
window.dump(aMsg + '\n'); | |
} else { | |
setTimeout(function () { | |
throw new Error('[debug] ' + aMsg); | |
}, 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment