Skip to content

Instantly share code, notes, and snippets.

@lexeek
Forked from mcs/gist:4059304
Created September 1, 2013 22:54
Show Gist options
  • Save lexeek/6407850 to your computer and use it in GitHub Desktop.
Save lexeek/6407850 to your computer and use it in GitHub Desktop.
/**
* Creates a log wrapper for browser console. If console.log is defined, it passed the function arguments to it.
* Using this method prevents problems when using console.log directly in IE (at least in version 8).
*/
var logger = function () {
if (console && console.log) {
console.log.call(console, arguments);
}
}
// ...
// later invocation
logger.log("%o", "Hello JavaScript!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment