From 5cfb6a56b250d43e4eb294a1fad160da70e244e9 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Fri, 20 Oct 2023 19:06:41 -0600 Subject: [PATCH] kgo tests: add timestamps --- pkg/kgo/helpers_test.go | 2 +- pkg/kgo/txn_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/kgo/helpers_test.go b/pkg/kgo/helpers_test.go index 4e8bc2fd..f7b8e97f 100644 --- a/pkg/kgo/helpers_test.go +++ b/pkg/kgo/helpers_test.go @@ -89,7 +89,7 @@ func testLogger() Logger { num := loggerNum.Add(1) pfx := strconv.Itoa(int(num)) return BasicLogger(os.Stderr, testLogLevel, func() string { - return time.Now().Format("[15:04:05 ") + pfx + "]" + return time.Now().UTC().Format("[15:04:05.999 ") + pfx + "]" }) } diff --git a/pkg/kgo/txn_test.go b/pkg/kgo/txn_test.go index 9a7f8d8f..63a6f5c8 100644 --- a/pkg/kgo/txn_test.go +++ b/pkg/kgo/txn_test.go @@ -28,7 +28,9 @@ func TestTxnEtl(t *testing.T) { go func() { cl, err := NewClient( getSeedBrokers(), - WithLogger(BasicLogger(os.Stderr, testLogLevel, nil)), + WithLogger(BasicLogger(os.Stderr, testLogLevel, func() string { + return time.Now().UTC().Format("15:04:05.999") + " " + })), TransactionalID("p"+randsha()), TransactionTimeout(2*time.Minute), MaxBufferedRecords(10000),