"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const configService_1 = require("./configService");
var LogLevel;
(function (LogLevel) {
    LogLevel[LogLevel["none"] = 0] = "none";
    LogLevel[LogLevel["info"] = 1] = "info";
    LogLevel[LogLevel["warn"] = 2] = "warn";
    LogLevel[LogLevel["debug"] = 4] = "debug";
    LogLevel[LogLevel["error"] = 8] = "error";
    LogLevel[LogLevel["all"] = 15] = "all";
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
class ConsoleLogger {
    constructor() {
        /* tslint:disable:no-console */
        /* tslint:disable:no-bitwise */
        this.level = parseInt(configService_1.ConfigService.get("logLevel"), 10);
        /* tslint:enable:no-console */
        /* tslint:enable:no-bitwise */
    }
    debug(message) { if (this.level & LogLevel.debug) {
        console.log(message);
    } }
    info(message) { if (this.level & LogLevel.info) {
        console.log(message);
    } }
    warn(message) { if (this.level & LogLevel.warn) {
        console.log(message);
    } }
    error(message) { if (this.level & LogLevel.error) {
        console.log(message);
    } }
}
class LoggingService {
    /* tslint:disable:max-line-length */
    static debug(message) { LoggingService.logger.debug(`${LoggingService.moduleName} (debug): ${message}`); }
    static info(message) { LoggingService.logger.info(`${LoggingService.moduleName} (info): ${message}`); }
    static warn(message) { LoggingService.logger.warn(`${LoggingService.moduleName} (warn): ${message}`); }
    static error(message) { LoggingService.logger.error(`${LoggingService.moduleName} (error): ${message}`); }
    /* tslint:enable:max-line-length */
    static setLogLevel(level) {
        LoggingService.logger.level = level;
    }
    static setLogger(logger) {
        LoggingService.logger = logger;
    }
}
LoggingService.logger = new ConsoleLogger();
LoggingService.moduleName = "Arc.js";
exports.LoggingService = LoggingService;
//# sourceMappingURL=loggingService.js.map