Last active
May 29, 2018 17:02
-
-
Save kmonsoor/0244fdb4ad79a4826371e58a1a5fa984 to your computer and use it in GitHub Desktop.
JavaScript -- Disable console.log & other in-browser console.* methods
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
"use strict"; | |
(() => { | |
var console = (window.console = window.console || {}); | |
[ | |
"assert", "clear", "count", "debug", "dir", "dirxml", | |
"error", "exception", "group", "groupCollapsed", "groupEnd", | |
"info", "log", "markTimeline", "profile", "profileEnd", "table", | |
"time", "timeEnd", "timeStamp", "trace", "warn" | |
].forEach(method => { | |
console[method] = () => {}; | |
}); | |
console.log("This message shouldn't be visible in console log"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment