Skip to content

Commit

Permalink
suppress chatty logs in CI. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk authored May 25, 2019
1 parent ce344a8 commit e464f55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions suites/mux/muxer_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
mrand "math/rand"

"github.com/libp2p/go-libp2p-core/mux"
"github.com/libp2p/go-libp2p-testing/ci"
)

var randomness []byte
Expand Down Expand Up @@ -57,7 +58,7 @@ func checkErr(t *testing.T, err error) {
}

func log(s string, v ...interface{}) {
if testing.Verbose() {
if testing.Verbose() && !ci.IsRunning() {
fmt.Fprintf(os.Stderr, "> "+s+"\n", v...)
}
}
Expand All @@ -74,7 +75,7 @@ type LogWriter struct {
}

func (lw *LogWriter) Write(buf []byte) (int, error) {
if testing.Verbose() {
if testing.Verbose() && !ci.IsRunning() {
log("logwriter: writing %d bytes", len(buf))
}
return lw.W.Write(buf)
Expand Down

0 comments on commit e464f55

Please sign in to comment.