Skip to content

Instantly share code, notes, and snippets.

@bkardell
Created September 29, 2013 01:46
Show Gist options
  • Select an option

  • Save bkardell/6748578 to your computer and use it in GitHub Desktop.

Select an option

Save bkardell/6748578 to your computer and use it in GitHub Desktop.
Your browser's console api now minimally conforms :-p
(function(){
var noOp = function(){};
var methods = [
'assert','clear','count','debug','dir','dirxml','error','exception',
'group', 'groupCollapsed', 'groupEnd', 'info', 'isIndependentlyComposed',
'log', 'profile', 'profileEnd', 'timeEnd', 'timeStamp', 'trace', 'warn'
];
methods.forEach(function (name) {
if( !console[name] ) {
console[name] = noOp;
}
});
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment