Skip to content

Instantly share code, notes, and snippets.

@NewFuture
Last active September 18, 2016 04:20
Show Gist options
  • Save NewFuture/35ccebdd49f47ebadcd5a7f279923908 to your computer and use it in GitHub Desktop.
Save NewFuture/35ccebdd49f47ebadcd5a7f279923908 to your computer and use it in GitHub Desktop.
var log = function() {
setTimeout(console.log.bind.apply(console.log, [null].concat(Array.prototype.slice.call(arguments))));
};
var YYF_CONSOLE = {
_console: function(method) {
return function() {
setTimeout(console[method].bind.apply(console[method], [console].concat(Array.prototype.slice.call(arguments))));
}
}
};
['assert','clear','count','debug','dir','dirxml','error','group','groupCollapsed','groupEnd','info','log','profile','profileEnd','time','timeEnd','timeStamp','warn'].forEach(function(method) {
YYF_CONSOLE[method] = YYF_CONSOLE._console(method);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment