Enable $AnsibleConfig.debug_mode

Angular logging now respects the debug_mode paraemter in the js/config.js file. When set to true $log.debug messages will appear in the browser console. Set to false and they no longer appear.
This commit is contained in:
Chris Houseknecht 2014-07-10 11:20:24 -04:00
parent fb09a4b693
commit 490d53419e
2 changed files with 15 additions and 1 deletions

View File

@ -392,6 +392,20 @@ angular.module('Tower', [
});
}
])
.config(function($provide) {
$provide.decorator('$log', function($delegate) {
var _debug = $delegate.debug;
$delegate.debug = function(msg) {
// only show debug messages when debug_mode set to true in config
if ($AnsibleConfig.debug_mode) {
_debug(msg);
}
}
return $delegate;
});
})
.run(['$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'ViewLicense',
'Timer', 'ClearScope', 'HideStream', 'Socket',
function ($compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, ViewLicense,

View File

@ -14,7 +14,7 @@ var $AnsibleConfig = {
tooltip_delay: {show: 500, hide: 100}, // Default number of milliseconds to delay displaying/hiding tooltips
debug_mode: true, // Enable console logging messages
debug_mode: false, // Enable console logging messages
password_strength: 45, // User password strength. Integer between 0 and 100, 100 being impossibly strong.
// This value controls progress bar colors: