ferngully-aurelia-tools
Version:
Ferngully Tools for Aurelia
52 lines • 3.25 kB
JavaScript
System.register(["aurelia-framework", "./configuration-service", "./environment-service"], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __moduleName = context_1 && context_1.id;
var aurelia_framework_1, configuration_service_1, environment_service_1, LoggingService;
return {
setters: [
function (aurelia_framework_1_1) {
aurelia_framework_1 = aurelia_framework_1_1;
},
function (configuration_service_1_1) {
configuration_service_1 = configuration_service_1_1;
},
function (environment_service_1_1) {
environment_service_1 = environment_service_1_1;
}
],
execute: function () {
LoggingService = (function () {
function LoggingService(configService, environmentService) {
this.configService = configService;
this.environmentService = environmentService;
}
LoggingService.prototype.configure = function () {
this.defaultModuleName = this.configService.get("logging-service.defaultModuleName");
this.logger = aurelia_framework_1.LogManager.getLogger(this.defaultModuleName);
aurelia_framework_1.LogManager.setLevel((this.environmentService.isDevelopment || this.environmentService.isStaging) ? aurelia_framework_1.LogManager.logLevel.debug : aurelia_framework_1.LogManager.logLevel.error);
};
LoggingService.prototype.debug = function (message) { this.logger.debug(message); };
LoggingService.prototype.info = function (message) { this.logger.info(message); };
LoggingService.prototype.warn = function (message) { this.logger.warn(message); };
LoggingService.prototype.error = function (message) { this.logger.error(message); };
LoggingService = __decorate([
aurelia_framework_1.autoinject,
__metadata("design:paramtypes", [configuration_service_1.ConfigurationService,
environment_service_1.EnvironmentService])
], LoggingService);
return LoggingService;
}());
exports_1("LoggingService", LoggingService);
}
};
});
//# sourceMappingURL=logging-service.js.map