[prodMode] Is there any simple way to disable log for production environment?
See original GitHub issueCurrently there is a log message depending on enableProdMode()
function being called which ends up with following log in prod mode:
Angular 2 is running in the production mode. Call enableDevMode() to enable the development mode.
How can I prevent Angular from logging such a message?
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The simplest way to disable console.log for Production build in ...
There are various ways you can disable console in the production, such as: By using libraries such as logger; Creating a linting rule...
Read more >Disabling console.log() in production - Stack Overflow
Solution is to add the polyfill to your polyfill.ts file if(!window.console) { var console = { log : function(){}, warn : function(){}, ...
Read more >Enabling and Disabling Angular Production Mode - Pluralsight
Let's look at how we can test initial stages without changing the URL every time and being able to change our environment's file...
Read more >Angular2.x – How to disable Console Logs in Production Build
I will let explain a trick where we can retain all of our console log statements, when in development mode, and disable all...
Read more >Remove console.log from Production Mode
log is one the debugging weapon or logger we use as javascript developer. The console. log method is a way for developers to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is my workarround, i hope it helps somebody.
In the maint.ts file use this
if (environment.production) { enableProdMode(); console.log = function (a, b, c, d, e, f, g, h, i, j, k, l) { return false; } }
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.