"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withDebugLogger = exports.getLogger = exports.withLogger = void 0;
const logger_1 = require("./logger");
const LOGGER_KEY = "ctx-key-logger";
const withLogger = (ctx, logger) => {
    return Object.assign(Object.assign({}, ctx), { [LOGGER_KEY]: logger });
};
exports.withLogger = withLogger;
const getLogger = (ctx) => {
    const l = ctx[LOGGER_KEY];
    if (l == undefined) {
        return logger_1.main;
    }
    return l;
};
exports.getLogger = getLogger;
const withDebugLogger = (ctx) => {
    return (0, exports.withLogger)(ctx, (0, logger_1.newLogger)({
        level: "DEBUG",
        name: "DEBUG",
    }));
};
exports.withDebugLogger = withDebugLogger;
//# sourceMappingURL=context.js.map