Created
January 22, 2018 15:43
-
-
Save JakeTheCorn/b9a95b549a3129eb34f1ceeb1e613353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $log.log will call $log.debug instead which is globally configurable from the debugEnabled call | |
(function() { | |
'use strict'; | |
angular.module('app') | |
.config(AppLogConfig); | |
AppLogConfig.$inject = ['$logProvider', 'IS_DEV_MODE', '$provide']; | |
function AppLogConfig($logProvider, IS_DEV_MODE, $provide) { | |
$provide.decorator('$log', ['$delegate', function ($delegate) { | |
$delegate.log = $delegate.debug; | |
return $delegate; | |
}]); | |
$logProvider.debugEnabled(IS_DEV_MODE); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment