This repository has been archived on 2022-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
AriaNg/src/scripts/services/ariaNgLogService.js

39 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-11-06 15:41:28 +01:00
(function () {
'use strict';
angular.module('ariaNg').factory('ariaNgLogService', ['$log', 'ariaNgSettingService', function ($log, ariaNgSettingService) {
return {
debug: function (msg, obj) {
if (ariaNgSettingService.isEnableDebugMode()) {
2017-03-20 15:43:55 +01:00
if (obj) {
$log.debug('[AriaNg Debug]' + msg, obj);
} else {
$log.debug('[AriaNg Debug]' + msg);
}
2016-11-06 15:41:28 +01:00
}
},
info: function (msg, obj) {
2017-03-20 15:43:55 +01:00
if (obj) {
$log.info('[AriaNg Info]' + msg, obj);
} else {
$log.info('[AriaNg Info]' + msg);
}
2016-11-06 15:41:28 +01:00
},
warn: function (msg, obj) {
2017-03-20 15:43:55 +01:00
if (obj) {
$log.warn('[AriaNg Warn]' + msg, obj);
} else {
$log.warn('[AriaNg Warn]' + msg);
}
2016-11-06 15:41:28 +01:00
},
error: function (msg, obj) {
2017-03-20 15:43:55 +01:00
if (obj) {
$log.error('[AriaNg Error]' + msg, obj);
} else {
$log.error('[AriaNg Error]' + msg);
}
2016-11-06 15:41:28 +01:00
}
};
}]);
}());