"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setLogLevel = exports.delegateLogger = exports.LoggerUtil = exports.DEFAULT_LOG_LEVEL = exports.LOG_ALL = exports.LOG_DEBUG = exports.LOG_INFO = exports.LOG_WARN = exports.LOG_ERROR = exports.LOG_FATAL = exports.LOG_NONE = exports.LOG_LEVEL = void 0;
var LOG_LEVEL;
(function (LOG_LEVEL) {
    LOG_LEVEL[LOG_LEVEL["TRACE"] = 2] = "TRACE";
    LOG_LEVEL[LOG_LEVEL["DEBUG"] = 4] = "DEBUG";
    LOG_LEVEL[LOG_LEVEL["INFO"] = 8] = "INFO";
    LOG_LEVEL[LOG_LEVEL["WARN"] = 16] = "WARN";
    LOG_LEVEL[LOG_LEVEL["ERROR"] = 32] = "ERROR";
    LOG_LEVEL[LOG_LEVEL["FATAL"] = 64] = "FATAL";
})(LOG_LEVEL = exports.LOG_LEVEL || (exports.LOG_LEVEL = {}));
exports.LOG_NONE = 0;
exports.LOG_FATAL = LOG_LEVEL.FATAL;
exports.LOG_ERROR = LOG_LEVEL.ERROR | LOG_LEVEL.FATAL;
exports.LOG_WARN = LOG_LEVEL.WARN | LOG_LEVEL.ERROR | LOG_LEVEL.FATAL;
exports.LOG_INFO = LOG_LEVEL.INFO | LOG_LEVEL.WARN | LOG_LEVEL.ERROR | LOG_LEVEL.FATAL;
exports.LOG_DEBUG = LOG_LEVEL.DEBUG | LOG_LEVEL.INFO | LOG_LEVEL.WARN | LOG_LEVEL.ERROR | LOG_LEVEL.FATAL;
exports.LOG_ALL = LOG_LEVEL.TRACE | LOG_LEVEL.DEBUG | LOG_LEVEL.INFO | LOG_LEVEL.WARN | LOG_LEVEL.ERROR | LOG_LEVEL.FATAL;
exports.DEFAULT_LOG_LEVEL = exports.LOG_WARN;
var level = exports.DEFAULT_LOG_LEVEL;
var logger = console;
function tryLogging(loglevel, logFunction, args) {
    if ((level & loglevel) > exports.LOG_NONE) {
        // eslint-disable-next-line prefer-spread
        logFunction.apply(null, args);
    }
}
var LoggerUtil = /** @class */ (function () {
    function LoggerUtil() {
    }
    LoggerUtil.delegateLogger = delegateLogger;
    LoggerUtil.setLogLevel = setLogLevel;
    return LoggerUtil;
}());
exports.LoggerUtil = LoggerUtil;
function delegateLogger(_logger) {
    logger = _logger;
}
exports.delegateLogger = delegateLogger;
function setLogLevel(_level) {
    level = _level;
}
exports.setLogLevel = setLogLevel;
exports.default = {
    trace: function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        // eslint-disable-next-line prefer-rest-params
        tryLogging(LOG_LEVEL.TRACE, logger.debug, arguments);
    },
    debug: function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        // eslint-disable-next-line prefer-rest-params
        tryLogging(LOG_LEVEL.DEBUG, logger.debug, arguments);
    },
    info: function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        // eslint-disable-next-line prefer-rest-params
        tryLogging(LOG_LEVEL.INFO, logger.info, arguments);
    },
    warn: function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        // eslint-disable-next-line prefer-rest-params
        tryLogging(LOG_LEVEL.WARN, logger.warn, arguments);
    },
    error: function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        // eslint-disable-next-line prefer-rest-params
        tryLogging(LOG_LEVEL.ERROR, logger.error, arguments);
    },
    fatal: function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        // eslint-disable-next-line prefer-rest-params
        tryLogging(LOG_LEVEL.FATAL, logger.error, arguments);
    }
};
//# sourceMappingURL=Logger.js.map