function genDebugFunction(namespace) {
    const fn = debug_1$2.default(`${NAMESPACE_PREFIX}:${namespace}`);
    function wrappedDebug(...args) {
        if (!fn.enabled) {
            return; // no-op
        }
        // we skip the first arg because that is the message
        for (let i = 1; i < args.length; i++) {
            const str = getStringValue(args[i]);
            if (typeof str === "string" && str.length > MAX_ARGUMENT_LENGTH) {
                args[i] = genRedactedString(str, MAX_ARGUMENT_LENGTH);
            }
        }
        return fn.apply(null, args);
    }
    Object.defineProperties(wrappedDebug, {
        namespace: {
            get() {
                return fn.namespace;
            },
        },
        enabled: {
            get() {
                return fn.enabled;
            },
        },
        destroy: {
            get() {
                return fn.destroy;
            },
        },
        log: {
            get() {
                return fn.log;
            },
            set(l) {
                fn.log = l;
            },
        },
    });
    return wrappedDebug;
}
a wrapper for the `debug` module, used to generate
"debug functions" that trim the values in their output