Created
April 9, 2013 10:54
-
-
Save dvdsmpsn/5344811 to your computer and use it in GitHub Desktop.
Twitter's console wrapper for non-supporting browsers
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
// http://stackoverflow.com/a/7585409 | |
// from twitter source | |
if ( ! window.console ) { | |
(function() { | |
var names = ['log', 'debug', 'info', 'warn', 'error', | |
'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', | |
'timeEnd', 'count', 'trace', 'profile', 'profileEnd'], | |
i, l = names.length; | |
window.console = {}; | |
for ( i = 0; i < l; i++ ) { | |
window.console[ names[i] ] = function() {}; | |
} | |
}()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment