Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat($LogProvider): flag to allow hide/show of $log.info()/$log.log() #5072

Closed
wants to merge 1 commit into from

Conversation

mwq27
Copy link

@mwq27 mwq27 commented Nov 21, 2013

Add method to set a flag to enable/disable $log.info() and $log.log() messages.
$logProvider.enableMessages(false|true)
This is similar to how $logProvider.debugEnabled() works.

  • I haven’t gotten the tests to pass yet, there’s an error in the logSpec saying $LogProvider undefined.

…o hide all $log.info() and $log.log() messages, but setting a flag in the config ($logProvider.enableMessages(false|true). I haven’t gotten the tests to pass yet, there’s an error in the logSpec saying $LogProvider undefined.
@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

Sorry, something went wrong.

@petebacondarwin
Copy link
Contributor

I wonder if we should keep adding all these configuration options. Are you suggesting that the logging level should change during application runtime?

Either we should have a log-level similar to many other logging libraries - below which messages don't appear. Or we should simply rely on decorating the $log service as necessary in our applications.

myModule.decorator('$log', ['$delegate', function($delegate) {
  $delegate.info = angular.noop;
  return $delegate;
}]);

@mwq27
Copy link
Author

mwq27 commented Nov 21, 2013

Yes that would work as well, the decorator. I just thought that if someone had a lot of $log info's in there code they needed to quickly hide those from the console, they could just enable the flag.

@lgalfaso
Copy link
Contributor

closing this in favor of #10585

@lgalfaso lgalfaso closed this Dec 28, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants