Created
May 7, 2014 08:28
-
-
Save egm0121/d8a48d137b215b11b74f to your computer and use it in GitHub Desktop.
hide console.log in prod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(a,b){var c,d={},e=function(){},f=function(){d.history=d.history||[],d.history.push(arguments),this.console&&original.log(Array.prototype.slice.call(arguments))},g=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],h=g.length,i=window.console=window.console||{};try{for(;h--;)c=g[h],i[c]="log"==c?f:e}catch(j){}b._unlockConsole=function(){i.log=a,d.history.map(function(a){i.log.apply(i,Array.prototype.slice.call(a))})}}(null!=console&&"object"==typeof console&&"log"in console?console.log:function(){},this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment