import { __spreadArrays } from "tslib";
var Logger = /** @class */ (function () {
    function Logger(options) {
        this.displayLogs = true;
        this.displayWarnings = true;
        this.displayDebugs = true;
        this.displayInfos = true;
        this.hideAll = false;
        this.setConsoleOptions(options);
    }
    Logger.prototype.setConsoleOptions = function (options) {
        if (options) {
            if (typeof (options.displayLogs) === 'boolean') {
                this.displayLogs = options.displayLogs;
            }
            if (typeof (options.displayWarnings) === 'boolean') {
                this.displayWarnings = options.displayWarnings;
            }
            if (typeof (options.displayDebugs) === 'boolean') {
                this.displayDebugs = options.displayDebugs;
            }
            if (typeof (options.displayInfos) === 'boolean') {
                this.displayInfos = options.displayInfos;
            }
            if (typeof (options.hideAll) === 'boolean') {
                this.hideAll = options.hideAll;
            }
        }
    };
    Logger.prototype.log = function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        if (!this.hideAll && this.displayLogs) {
            console.log.apply(console, __spreadArrays([message], optionalParams));
        }
    };
    Logger.prototype.warn = function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        if (!this.hideAll && this.displayWarnings) {
            console.warn.apply(console, __spreadArrays([message], optionalParams));
        }
    };
    Logger.prototype.debug = function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        if (!this.hideAll && this.displayDebugs) {
            console.debug.apply(console, __spreadArrays([message], optionalParams));
        }
    };
    Logger.prototype.info = function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        if (!this.hideAll && this.displayInfos) {
            console.info.apply(console, __spreadArrays([message], optionalParams));
        }
    };
    Logger.prototype.error = function (message) {
        var optionalParams = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            optionalParams[_i - 1] = arguments[_i];
        }
        if (!this.hideAll) {
            console.error.apply(console, __spreadArrays([message], optionalParams));
        }
    };
    return Logger;
}());
export { Logger };
var LoggerPlugin = {
    install: function (v, options) {
        var logger = new Logger(options);
        logger.debug('$logger', 'plugin.install');
        (v.prototype).$log = logger;
    }
};
export default LoggerPlugin;
//# sourceMappingURL=logger.js.map