@@ -7,7 +7,6 @@ package main
7
7
import (
8
8
"fmt"
9
9
"io"
10
- "io/ioutil"
11
10
"log"
12
11
"net/http"
13
12
"os"
@@ -33,6 +32,7 @@ import (
33
32
"github.com/gorilla/mux"
34
33
"github.com/julienschmidt/httprouter"
35
34
"github.com/labstack/echo"
35
+ llog "github.com/lunny/log"
36
36
"github.com/lunny/tango"
37
37
vulcan "github.com/mailgun/route"
38
38
"github.com/naoina/denco"
@@ -930,19 +930,21 @@ func tangoHandlerWrite(ctx *tango.Context) {
930
930
931
931
func initTango () {
932
932
tango .Env = tango .Prod
933
+ llog .SetOutput (new (mockResponseWriter ))
934
+ llog .SetOutputLevel (llog .Lnone )
933
935
}
934
936
935
937
func loadTango (routes []route ) http.Handler {
936
- tg := tango .NewWithLog (tango . NewLogger ( ioutil . Discard ) )
938
+ tg := tango .NewWithLog (llog . Std )
937
939
for _ , route := range routes {
938
- tg .Route ([] string { route .method } , route .path , tangoHandler )
940
+ tg .Route (route .method , route .path , tangoHandler )
939
941
}
940
942
return tg
941
943
}
942
944
943
945
func loadTangoSingle (method , path string , handler func (* tango.Context )) http.Handler {
944
- tg := tango .NewWithLog (tango . NewLogger ( ioutil . Discard ) )
945
- tg .Route ([] string { method } , path , handler )
946
+ tg := tango .NewWithLog (llog . Std )
947
+ tg .Route (method , path , handler )
946
948
return tg
947
949
}
948
950
0 commit comments