Will use of the debugging feature console.log reduce JavaScript execution performance? Will it affect the speed of script execution in production environments?
Is there an approach to disable console logs in production environments from a single configuration location?
If you are going to have this on a public site or something, anyone with little knowledge on using the developer tools can read your debug messages. Depending on what you are logging, this may not be a desirable behavior.
One of the best approaches is to wrap the
console.login one of your methods, and where you can check for conditions and execute it. In a production build, you can avoid having these functions. This Stack Overflow question talks in details about how to do the same using the Closure compiler.So, to answer your questions:
though only negligibly.