From 029fd3795568e6541783fbec89d701dad81ddd00 Mon Sep 17 00:00:00 2001 From: pinarrkok Date: Sat, 28 Dec 2024 18:27:24 +0300 Subject: [PATCH] feat: add logs for retry producing with backoff --- batch_consumer.go | 3 +-- consumer.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/batch_consumer.go b/batch_consumer.go index c56812a..c338b55 100644 --- a/batch_consumer.go +++ b/batch_consumer.go @@ -3,7 +3,6 @@ package kafka import ( "errors" "fmt" - "github.com/gofiber/fiber/v2/log" "time" "github.com/prometheus/client_golang/prometheus" @@ -263,7 +262,7 @@ func (b *batchConsumer) retryBatchWithBackoff(retryableMessages []kcronsumer.Mes if produceErr == nil { return nil } - log.Warnf("Error producing message (attempt %d/%d): %v", attempt, 5, produceErr) + b.logger.Warnf("Error producing message (attempt %d/%d): %v", attempt, 5, produceErr) time.Sleep((50 * time.Millisecond) * time.Duration(1<