Silence KafkaJS client logs
Some checks failed
deploy / deploy (push) Failing after 0s

This commit is contained in:
philipp 2026-04-01 01:07:10 +02:00
parent f35f64513f
commit 8b58681c35
2 changed files with 12 additions and 4 deletions

View file

@ -1,8 +1,12 @@
import { Kafka } from 'kafkajs';
import { Kafka, logLevel } from 'kafkajs';
import { serializeError } from '../../core/log.mjs';
function createKafka({ brokers = ['127.0.0.1:9092'], clientId = 'unrip' } = {}) {
return new Kafka({ clientId, brokers });
return new Kafka({
clientId,
brokers,
logLevel: logLevel.NOTHING,
});
}
export async function createConsumer({ groupId, logger, ...options }) {

View file

@ -1,8 +1,12 @@
import { Kafka } from 'kafkajs';
import { Kafka, logLevel } from 'kafkajs';
import { serializeError } from '../../core/log.mjs';
function createKafka({ brokers = ['127.0.0.1:9092'], clientId = 'unrip' } = {}) {
return new Kafka({ clientId, brokers });
return new Kafka({
clientId,
brokers,
logLevel: logLevel.NOTHING,
});
}
export async function createProducer({ logger, ...options } = {}) {