1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
//go:build !functional
package sarama
import "testing"
// testLogger implements the StdLogger interface and records the text in the
// logs of the given T passed from Test functions.
// and records the text in the error log.
//
// nolint:unused
type testLogger struct {
t *testing.T
}
// nolint:unused
func (l *testLogger) Print(v ...interface{}) {
if l.t != nil {
l.t.Helper()
l.t.Log(v...)
}
}
// nolint:unused
func (l *testLogger) Printf(format string, v ...interface{}) {
if l.t != nil {
l.t.Helper()
l.t.Logf(format, v...)
}
}
// nolint:unused
func (l *testLogger) Println(v ...interface{}) {
if l.t != nil {
l.t.Helper()
l.t.Log(v...)
}
}
|