2017-09-13 13:27:34 +08:00
|
|
|
(function () {
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
// Users service used for communicating with the users REST endpoint
|
|
|
|
|
angular
|
|
|
|
|
.module('core')
|
|
|
|
|
.factory('DebugConsoleService', DebugConsoleService);
|
|
|
|
|
|
2018-05-28 00:03:58 +08:00
|
|
|
DebugConsoleService.$inject = ['MeanTorrentConfig', 'Authentication'];
|
2017-09-13 13:27:34 +08:00
|
|
|
|
2018-05-28 00:03:58 +08:00
|
|
|
function DebugConsoleService(MeanTorrentConfig, Authentication) {
|
2017-09-13 13:27:34 +08:00
|
|
|
var appConfig = MeanTorrentConfig.meanTorrentConfig.app;
|
2018-05-28 00:03:58 +08:00
|
|
|
var announceConfig = MeanTorrentConfig.meanTorrentConfig.announce;
|
2017-09-13 13:27:34 +08:00
|
|
|
|
|
|
|
|
var service = {
|
|
|
|
|
info: debugInfo
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return service;
|
|
|
|
|
|
|
|
|
|
function debugInfo(obj) {
|
2018-05-28 00:19:48 +08:00
|
|
|
if (appConfig.showClientDebugLog && announceConfig.debugClientSideUser.ids.includes(Authentication.user._id)) {
|
2017-09-13 13:27:34 +08:00
|
|
|
console.log(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}());
|