Skip to content

Allow muting the Angular 2 mode printing in the browser console. #6540

Closed

Description

@emesx

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.

Activity

  1. deeleman commented on Jan 18, 2016

    @deeleman

    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.

  2. samjulien commented on Jan 22, 2016

    @samjulien
    Contributor

    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()?

  3. deeleman commented on Jan 22, 2016

    @deeleman

    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.

    Make sure to conform to the contribution guidelines when submitting your PR ;-)

  4. samjulien commented on Jan 22, 2016

    @samjulien
    Contributor

    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.

  5. emesx commented on Feb 29, 2016

    @emesx
    Author

    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?

  6. added
    area: coreIssues related to the framework runtime
    and removed on Sep 7, 2016
  7. vicb commented on Oct 7, 2016

    @vicb
    Contributor

    obsolete (dart related)

  8. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimeeffort1: hoursopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions