Skip to content

Instantly share code, notes, and snippets.



Created May 15, 2015
What would you like to do?
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