@creditkarma/dynamic-config
Version:
Dynamic Config for Node.js backed by Consul and Vault
33 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultLogger = void 0;
function isDebug() {
return process.env.CONFIG_DEBUG === 'true' || process.env.DEBUG === 'true';
}
exports.defaultLogger = {
log(msg, data) {
if (data !== undefined && isDebug()) {
console.log(`[dynamic-config:info]: ${msg}: `, data);
}
else if (isDebug()) {
console.log(`[dynamic-config:info]: ${msg}`);
}
},
warn(msg, data) {
if (data !== undefined && isDebug()) {
console.warn(`[dynamic-config:warn]: ${msg}: `, data);
}
else if (isDebug()) {
console.warn(`[dynamic-config:warn]: ${msg}`);
}
},
error(msg, data) {
if (data !== undefined) {
console.error(`[dynamic-config:error]: ${msg}: `, data);
}
else {
console.error(`[dynamic-config:error]: ${msg}`);
}
},
};
//# sourceMappingURL=logger.js.map