diff --git a/packet_handler_map.go b/packet_handler_map.go index e158b53e..3312e377 100644 --- a/packet_handler_map.go +++ b/packet_handler_map.go @@ -96,7 +96,7 @@ func newPacketHandlerMap( ) (packetHandlerManager, error) { if err := setReceiveBuffer(c, logger); err != nil { receiveBufferWarningOnce.Do(func() { - log.Println(err) + log.Printf("%s. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.", err) }) } conn, err := wrapConn(c) diff --git a/packet_handler_map_test.go b/packet_handler_map_test.go index 86dd7924..06cb9b8f 100644 --- a/packet_handler_map_test.go +++ b/packet_handler_map_test.go @@ -4,10 +4,7 @@ import ( "bytes" "crypto/rand" "errors" - "io/ioutil" - "log" "net" - "os" "time" mocklogging "github.com/lucas-clemente/quic-go/internal/mocks/logging" @@ -66,7 +63,6 @@ var _ = Describe("Packet Handler Map", func() { }) JustBeforeEach(func() { - log.SetOutput(ioutil.Discard) conn = NewMockPacketConn(mockCtrl) conn.EXPECT().LocalAddr().Return(&net.UDPAddr{}).AnyTimes() conn.EXPECT().ReadFrom(gomock.Any()).DoAndReturn(func(b []byte) (int, net.Addr, error) { @@ -81,8 +77,6 @@ var _ = Describe("Packet Handler Map", func() { handler = phm.(*packetHandlerMap) }) - AfterEach(func() { log.SetOutput(os.Stdout) }) - It("closes", func() { getMultiplexer() // make the sync.Once execute // replace the clientMuxer. getClientMultiplexer will now return the MockMultiplexer diff --git a/quic_suite_test.go b/quic_suite_test.go index a26b3504..d8a0a2e0 100644 --- a/quic_suite_test.go +++ b/quic_suite_test.go @@ -1,6 +1,8 @@ package quic import ( + "io/ioutil" + "log" "sync" "testing" @@ -23,6 +25,10 @@ var _ = BeforeEach(func() { connMuxerOnce = *new(sync.Once) }) +var _ = BeforeSuite(func() { + log.SetOutput(ioutil.Discard) +}) + var _ = AfterEach(func() { mockCtrl.Finish() })