Skip to content

Commit

Permalink
feat(plc4go): change to TestingLog interface for TestLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Apr 10, 2024
1 parent d7a8e79 commit 482817e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plc4go/spi/testutils/TestUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,14 @@ func shouldNoColor() bool {
return noColor
}

type TestingLog interface {
Log(args ...interface{})
Logf(format string, args ...interface{})
Helper()
}

// ProduceTestingLogger produces a logger which redirects to testing.T
func ProduceTestingLogger(t *testing.T) zerolog.Logger {
func ProduceTestingLogger(t TestingLog) zerolog.Logger {
noColor := shouldNoColor()
consoleWriter := zerolog.NewConsoleWriter(
zerolog.ConsoleTestWriter(t),
Expand Down

0 comments on commit 482817e

Please sign in to comment.