@creditkarma/consul-client
Version:
A client for Hashicorp Consul written in TypeScript
34 lines • 966 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.error = exports.warn = exports.log = void 0;
function isDebug() {
return process.env.CONSUL_DEBUG === 'true' || process.env.DEBUG === 'true';
}
const log = (msg, data) => {
if (data !== undefined && isDebug()) {
console.log(`[consul-client:info]: ${msg}: `, data);
}
else if (isDebug()) {
console.log(`[consul-client:info]: ${msg}`);
}
};
exports.log = log;
const warn = (msg, data) => {
if (data !== undefined) {
console.warn(`[consul-client:warn]: ${msg}: `, data);
}
else {
console.warn(`[consul-client:warn]: ${msg}`);
}
};
exports.warn = warn;
const error = (msg, data) => {
if (data !== undefined) {
console.error(`[consul-client:error]: ${msg}: `, data);
}
else {
console.error(`[consul-client:error]: ${msg}`);
}
};
exports.error = error;
//# sourceMappingURL=logger.js.map