Selaa lähdekoodia

codec: test: discard messages from log package

Some libraries log messages using the log package.

These messages only serve to clutter the test output.

Send those messages to equivalent of /dev/null
Ugorji Nwoke 8 vuotta sitten
vanhempi
commit
d00b2d1703
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      codec/shared_test.go

+ 3 - 0
codec/shared_test.go

@@ -45,6 +45,8 @@ import (
 	"flag"
 	"fmt"
 	"io"
+	"io/ioutil"
+	"log"
 	"sync"
 	"testing"
 )
@@ -133,6 +135,7 @@ var (
 )
 
 func init() {
+	log.SetOutput(ioutil.Discard) // don't allow things log to standard out/err
 	testHEDs = make([]testHED, 0, 32)
 	testHandles = append(testHandles,
 		// testNoopH,