$log

The main purpose of this service is to simplify debugging and troubleshooting.

Methods

  • log();

    Write a log message
  • info();

    Write an information message
  • warn();

    Write a warning message
  • error();

    Write an error message
  • debug();

    Write a debug message

This is only available in AngularJs 1.1.2 or later.

By default it is on.

Here is an example of it being set.


var app = angular.module('app', []);

app.config(function($logProvider){
  $logProvider.debugEnabled(true);
});

app.controller('MainCtrl', function($scope, $log ) {
  $scope.name = 'World';
  $scope.model = {value: "test"};
  $log.debug('TEST Log');
});