How to quickly and conveniently disable all console.log statements in my code?

后端 未结 28 2572
深忆病人
深忆病人 2020-11-22 16:48

Is there any way to turn off all console.log statements in my JavaScript code, for testing purposes?

28条回答
  •  半阙折子戏
    2020-11-22 17:44

    You can use logeek, It allows you to control your log messages visibility. Here is how you do that:

    
    
    logeek.show('security');
    
    logeek('some message').at('copy');       //this won't be logged
    logeek('other message').at('secturity'); //this would be logged
    

    You can also logeek.show('nothing') to totally disable every log message.

提交回复
热议问题