You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow muting the Angular 2 mode printing in the browser console. #6540
The current implementation prints out the mode of Angular 2 to the browser's console
(see application_ref.ts ). In Dart it's not even possible to call enableDevMode() any more, since it's a no-op now.
Please add an option to mute this output (other than manually rebinding the Console) so that it's possible to have production code clean of any debug / diagnostic printouts.
This is certainly a bit annoying. While muting this by hand is pretty straightforward (it just takes to remove the logging from the Completer Promise returned by the bootstrap function), it would be great to have a more discreet way to inspect this information if required. The object resulted by the bootstrap() function itself might be a good place for that. Otherwise, adding a boolean parameter to the enableProdMode() function signature informing wether we want to get those printouts or not might be fine as well. Wish I had some time to send a PR myself.
First-timer here, trying my hand at this. Building off of what @deeleman said, would it would work to follow the pattern of assertionsEnabled() and export a boolean muteMode() function that gets set by a boolean passed into enableProductionMode()?
Not being an authorized voice myself, that sounds like a good approach to me @samjulien. Obviously your starting point for this will be editing /modules/angular2/src/facade/lang.ts as you mentioned already.
Okay, great, thanks @deeleman. Code fix itself looks pretty straightforward, combing through the dev docs and contribution guidelines to make sure my styles and testing are compliant. :) I'll ping if I have any other questions.
Perhaps the original issue is resolved (i.e. the message is not printed in prod mode in Dart), but the message - whenever it might get printed - is misleading.
Activity
deeleman commentedon Jan 18, 2016
This is certainly a bit annoying. While muting this by hand is pretty straightforward (it just takes to remove the logging from the Completer Promise returned by the bootstrap function), it would be great to have a more discreet way to inspect this information if required. The object resulted by the
bootstrap()function itself might be a good place for that. Otherwise, adding a boolean parameter to theenableProdMode()function signature informing wether we want to get those printouts or not might be fine as well. Wish I had some time to send a PR myself.samjulien commentedon Jan 22, 2016
First-timer here, trying my hand at this. Building off of what @deeleman said, would it would work to follow the pattern of assertionsEnabled() and export a boolean muteMode() function that gets set by a boolean passed into enableProductionMode()?
deeleman commentedon Jan 22, 2016
Not being an authorized voice myself, that sounds like a good approach to me @samjulien. Obviously your starting point for this will be editing
/modules/angular2/src/facade/lang.tsas you mentioned already.Make sure to conform to the contribution guidelines when submitting your PR ;-)
samjulien commentedon Jan 22, 2016
Okay, great, thanks @deeleman. Code fix itself looks pretty straightforward, combing through the dev docs and contribution guidelines to make sure my styles and testing are compliant. :) I'll ping if I have any other questions.
emesx commentedon Feb 29, 2016
Hey, it's been a while since I created this issue, but AFAICT it still is unresolved.
The console message still says to call enableProdMode() but that function still does nothing (in Dart).
Perhaps the original issue is resolved (i.e. the message is not printed in prod mode in Dart), but the message - whenever it might get printed - is misleading.
What do you think?
vicb commentedon Oct 7, 2016
obsolete (dart related)
angular-automatic-lock-bot commentedon Sep 9, 2019
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.