var myApp = angular.module('myApp', []); myApp.config(function ($logProvider) { $logProvider.debugEnabled(true); }); myApp.controller('myCtrl', function ($scope, $log) { $scope.printDebugLog = function () { $log.debug("debugLog"); }; } );
<div ng-app="myApp"> <div ng-controller="myCtrl"> <button ng-click="printDebugLog()">print debug log</button> </div> </div>