log instead of fmt

This commit is contained in:
varyoo
2017-09-29 15:57:42 +02:00
parent 830f637e06
commit 88f09c3939
2 changed files with 13 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ package dnstapio
import (
"bytes"
"io/ioutil"
"log"
"sync"
"testing"
"time"
@@ -10,6 +11,10 @@ import (
tap "github.com/dnstap/golang-dnstap"
)
func init() {
log.SetOutput(ioutil.Discard)
}
type buf struct {
*bytes.Buffer
cost time.Duration
@@ -27,7 +32,6 @@ func (b buf) Close() error {
func TestRace(t *testing.T) {
b := buf{&bytes.Buffer{}, 100 * time.Millisecond}
dio := New(b)
dio.iolog = ioutil.Discard // don't flood Travis
wg := &sync.WaitGroup{}
wg.Add(10)
for i := 0; i < 10; i++ {