Skip to content

Commit 27cc99a

Browse files
committed
Prevent Tango from writing to stdout
Tango initializes itself with a logger to stdout, which gets quite long during all of the benchmark requests. https://github.com/lunny/tango/blob/master/tan.go#L199 Instead write to /dev/null (ioutil.Discard).
1 parent d373aca commit 27cc99a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

routers.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package main
77
import (
88
"fmt"
99
"io"
10+
"io/ioutil"
1011
"log"
1112
"net/http"
1213
"os"
@@ -909,15 +910,15 @@ func initTango() {
909910
}
910911

911912
func loadTango(routes []route) http.Handler {
912-
tg := tango.New()
913+
tg := tango.NewWithLog(tango.NewLogger(ioutil.Discard))
913914
for _, route := range routes {
914915
tg.Route([]string{route.method}, route.path, tangoHandler)
915916
}
916917
return tg
917918
}
918919

919920
func loadTangoSingle(method, path string, handler func(*tango.Context)) http.Handler {
920-
tg := tango.New()
921+
tg := tango.NewWithLog(tango.NewLogger(ioutil.Discard))
921922
tg.Route([]string{method}, path, handler)
922923
return tg
923924
}

0 commit comments

Comments
 (0)