const logLvlVal = {
    debug: 0,
    info: 0,
    warn: 0,
    error: 1,
};
export class Log {
    constructor(logLvl) {
        this.lvl = 0;
        if (logLvl && logLvlVal[logLvl]) {
            this.lvl = logLvlVal[logLvl];
        }
    }
    debug(msg, ...supportingDetails) {
        this.emitLogMessage('debug', msg, supportingDetails);
    }
    info(msg, ...supportingDetails) {
        this.emitLogMessage('info', msg, supportingDetails);
    }
    warn(msg, ...supportingDetails) {
        this.emitLogMessage('warn', msg, supportingDetails);
    }
    error(msg, ...supportingDetails) {
        this.emitLogMessage('error', msg, supportingDetails);
    }
    emitLogMessage(msgType, msg, supportingDetails) {
        if (this.lvl <= logLvlVal[msgType]) {
            return;
        }
        if (supportingDetails.length > 0) {
            // @ts-ignore
            console[msgType](msg, ...supportingDetails);
        }
        else {
            console[msgType](msg);
        }
    }
}
//# sourceMappingURL=index.js.map