Skip to content

Commit c98c843

Browse files
committed
disable log
1 parent b730f13 commit c98c843

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

routers.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/ant0ine/go-json-rest/rest"
1717
"github.com/lunny/tango"
18+
llog "github.com/lunny/log"
1819
"github.com/astaxie/beego"
1920
"github.com/astaxie/beego/context"
2021
"github.com/bmizerany/pat"
@@ -68,6 +69,7 @@ func init() {
6869
// makes logging 'webscale' (ignores them)
6970
log.SetOutput(new(mockResponseWriter))
7071
nullLogger = log.New(new(mockResponseWriter), "", 0)
72+
llog.SetOutput(new(mockResponseWriter))
7173

7274
initTango()
7375
initBeego()
@@ -103,16 +105,16 @@ func initBeego() {
103105
}
104106

105107
func loadTango(routes []route) http.Handler {
106-
tg := tango.New()
108+
tg := tango.NewWithLog(llog.Std)
107109
for _, route := range routes {
108-
tg.Route([]string{route.method}, route.path, tangoHandler)
110+
tg.Route(route.method, route.path, tangoHandler)
109111
}
110112
return tg
111113
}
112114

113115
func loadTangoSingle(method, path string, handler func(*tango.Context)) http.Handler {
114-
tg := tango.New()
115-
tg.Route([]string{method}, path, handler)
116+
tg := tango.NewWithLog(llog.Std)
117+
tg.Route(method, path, handler)
116118
return tg
117119
}
118120

0 commit comments

Comments
 (0)