"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const moment = require("moment");
var Level;
(function (Level) {
    Level[Level["All"] = 0] = "All";
    Level[Level["NoDebug"] = 1] = "NoDebug";
    Level[Level["NoDebugNoInfo"] = 2] = "NoDebugNoInfo";
    Level[Level["NoDebugNoInfoNoWarning"] = 3] = "NoDebugNoInfoNoWarning";
})(Level || (Level = {}));
var level = Level.NoDebug;
function timestamp() {
    return moment().format('HH:mm:ss.SSS');
}
function setLevel(value) {
    switch (value) {
        case 'info':
            level = Level.NoDebug;
            break;
        case 'warn':
            level = Level.NoDebugNoInfo;
            break;
        case 'error':
            level = Level.NoDebugNoInfoNoWarning;
            break;
        default: level = Level.All;
    }
}
exports.setLevel = setLevel;
function info(message) {
    if (level < Level.NoDebugNoInfo) {
        console.log(`${timestamp()} [ II ] ${message}`);
    }
}
exports.info = info;
function warn(message) {
    if (level < Level.NoDebugNoInfoNoWarning) {
        console.log(`${timestamp()} [ WW ] ${message}`);
    }
}
exports.warn = warn;
function error(message) {
    console.log(`${timestamp()} [ EE ] ${message}`);
}
exports.error = error;
function success(message) {
    console.log(`${timestamp()} [ OK ] ${message}`);
}
exports.success = success;
function debug(message) {
    if (level < Level.NoDebug) {
        console.log(`${timestamp()} [ DB ] ${message}`);
    }
}
exports.debug = debug;
//# sourceMappingURL=log.js.map