Skip to content

Instantly share code, notes, and snippets.

@niraj-rai
Last active August 20, 2019 06:35
Show Gist options
  • Save niraj-rai/1c983d17a09321ec9908e5187896f7d6 to your computer and use it in GitHub Desktop.
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
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