Skip to content

Commit

Permalink
chore(test): add verbose logger for unittests
Browse files Browse the repository at this point in the history
Capture sarama logging output when tests are run with `-v`

Signed-off-by: Dominic Evans <[email protected]>
  • Loading branch information
dnwe committed Aug 7, 2023
1 parent 03368ff commit f4f435c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sarama_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//go:build !functional
// +build !functional

package sarama

import (
"flag"
"log"
"os"
"testing"
)

func TestMain(m *testing.M) {
flag.Parse()
if f := flag.Lookup("test.v"); f != nil && f.Value.String() == "true" {
Logger = log.New(os.Stderr, "[Sarama] ", log.LstdFlags)
}
os.Exit(m.Run())
}

0 comments on commit f4f435c

Please sign in to comment.