Skip to content

Instantly share code, notes, and snippets.

@rjmunro
Created May 15, 2015 13:29
Show Gist options
  • Save rjmunro/faf9d917972248c750d8 to your computer and use it in GitHub Desktop.
Save rjmunro/faf9d917972248c750d8 to your computer and use it in GitHub Desktop.
Shim for console.log in IE9 when run without developer tools
// Shim console.log for IE9 when not run in with developer tools opened
// Stores log messages in window.consoleLog so you can retreive them when you open the tools.
(function () {
/*global window */
if (!window.console) {
window.consoleLog = [];
window.console = {
log: function (msg) {
window.consoleLog.push([msg, (new Date()).toIsoString()]);
}
};
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment