Last active
August 20, 2019 06:35
-
-
Save niraj-rai/1c983d17a09321ec9908e5187896f7d6 to your computer and use it in GitHub Desktop.
Override window.console.log function to not log console message in production environment - Angular
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
if (environment.production) { | |
enableProdMode(); | |
// HACK: Don't log to console in production environment. | |
// TODO: This can be done in better way using logger service and logger factory. | |
if(window){ | |
window.console.log = window.console.warn = window.console.info = function(){ | |
// Don't log anything. | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment