export { debug, info, error, warning, setLogLevel, getLogLevel };
var MsgType;
(function (MsgType) {
    MsgType["debug"] = "DEBUG";
    MsgType["info"] = "INFO";
    MsgType["error"] = "ERROR";
    MsgType["warning"] = "WARNING";
})(MsgType || (MsgType = {}));
var LogColor;
(function (LogColor) {
    LogColor["red"] = "\u001B[91m";
    LogColor["green"] = "\u001B[92m";
    LogColor["blue"] = "\u001B[36m";
    LogColor["yellow"] = "\u001B[93m";
    LogColor["stopColor"] = "\u001B[0m";
})(LogColor || (LogColor = {}));
let logLevel = 1;
function setLogLevel(level) {
    logLevel = level;
}
function getLogLevel() {
    return logLevel;
}
function debug(message) {
    if (logLevel >= 3) {
        emitLogMessage(MsgType.debug, message, LogColor.blue);
    }
}
function info(message) {
    if (logLevel >= 2) {
        emitLogMessage(MsgType.info, message, LogColor.green);
    }
}
function error(message) {
    if (logLevel != -1) {
        emitLogMessage(MsgType.error, message, LogColor.red);
    }
}
function warning(message) {
    if (logLevel >= 1) {
        emitLogMessage(MsgType.warning, message, LogColor.yellow);
    }
}
function emitLogMessage(msgType, message, color) {
    const time = getTimestamp();
    console.log(`[${time}] ${color}${msgType}:${LogColor.stopColor} ${message}`);
}
function getTimestamp() {
    const pad = (n, s = 2) => `${new Array(s).fill(0)}${n}`.slice(-s);
    const date = new Date();
    return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}:${pad(date.getMilliseconds(), 3)}`;
}
//# sourceMappingURL=logger.js.map