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

后端 未结 28 2554
深忆病人
深忆病人 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:39

    If you use Grunt you can add a task in order to remove/comment the console.log statements. Therefore the console.log are no longer called.

    https://www.npmjs.org/package/grunt-remove-logging-calls

提交回复
热议问题