Skip to content

Logging and Debugging

Simon Walsh edited this page Feb 17, 2015 · 3 revisions

Instead of using the normal console.log("foo", bar, ...) method, you should use the Angular provider equivalent like so: $log.debug("foo", bar, ...).

Note: make sure you add the $log provider as a dependency of your service/directive/controller.

This way, these logs will be disabled when moving to production without you having to do anything about it.

For more info: https://docs.angularjs.org/api/ng/service/$log

Clone this wiki locally