Last years word was “Finish”.
Many things were finished. Some good, some bad, and some that just needed to be done. All in all I think I did that very well with that word. Even more impressive to me was that I didn’t remember that was the word until the 2nd of this year. Reflecting back I’m glad I set that as my word for the year, wrote it down and it stuck.
Simplify is the word for 2015. My hope is that I get a good routine down and stop worrying about things I can’t control. We’ll see what else falls out of this year around simplifying.
The AngularJS $logProvider
Enabling the $logProvider is as simple as injecting the $log object into your object and then calling $log.debug(); to send logs to the console.
Turning off logging
You can disable logging (AngularJS 1.1.2+) by calling
AngularJS provides a mechanisms to extend the built in $logProvider, $provider.decorator(). An example will get the point across much more quickly than me trying to explain it all.
Basically we intercept the call using decorate so we can add on the features and functionality we need to the $log.debug() call.
AngualrJS version 1.2.16 was used as a basis for this article.
Thanks to Burleson Thomas and this post for the extension example.