Skip to content

Instantly share code, notes, and snippets.

@ubermajestix
Forked from pjhoberman/gist:768316
Created January 6, 2011 18:39
Show Gist options
  • Save ubermajestix/768317 to your computer and use it in GitHub Desktop.
Save ubermajestix/768317 to your computer and use it in GitHub Desktop.
// wrapper to prevent ie erroring out on leftover console.logs
function log(log)
{
if( typeof console !== "undefined" )
console.log( log );
} // log
// this version is nice because you can do this:
// var boom = 'booooom!';
// log('some value:', boom, 2);// => "some value booooom! 2"
// which saves you frome playing the 'quote plus plus quote' game
function log(){
if(window.console) {
console.log.apply(console, arguments);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment