goyave.dev/goyave/v5@v5.0.0-rc9.0.20240517145003-d3f977d0b9f3/util/testutil/logger.go (about)

     1  package testutil
     2  
     3  // LogWriter implementation of `io.Writer` redirecting the logs to `testing.T.Log()`
     4  type LogWriter struct {
     5  	t interface {
     6  		Log(args ...any)
     7  	}
     8  }
     9  
    10  func (w LogWriter) Write(b []byte) (int, error) {
    11  	w.t.Log(string(b))
    12  	return len(b), nil
    13  }