@aptpod/iscp-ts
Version:
iSCP 2.0 client library for TypeScript
49 lines • 1.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toOutputFlag = void 0;
const model_1 = require("../model");
const toOutputFlag = (logLevel) => {
if (logLevel === model_1.LOG_LEVEL.NONE) {
return {
DEBUG: false,
INFO: false,
WARNING: false,
ERROR: false,
};
}
if (logLevel === model_1.LOG_LEVEL.DEBUG) {
return {
DEBUG: true,
INFO: true,
WARNING: true,
ERROR: true,
};
}
if (logLevel === model_1.LOG_LEVEL.INFO) {
return {
DEBUG: false,
INFO: true,
WARNING: true,
ERROR: true,
};
}
if (logLevel === model_1.LOG_LEVEL.WARNING) {
return {
DEBUG: false,
INFO: false,
WARNING: true,
ERROR: true,
};
}
if (logLevel === model_1.LOG_LEVEL.ERROR) {
return {
DEBUG: false,
INFO: false,
WARNING: false,
ERROR: true,
};
}
throw new TypeError('logLevel is unsupported.');
};
exports.toOutputFlag = toOutputFlag;
//# sourceMappingURL=utils.js.map