Chore: replace macaron with web package (#40136)

* replace macaron with web package

* add web.go
This commit is contained in:
Serge Zaitsev
2021-10-11 14:30:59 +02:00
committed by GitHub
parent 78ebac0116
commit 57fcfd578d
70 changed files with 369 additions and 375 deletions
+4 -4
View File
@@ -21,15 +21,15 @@ import (
"github.com/grafana/grafana/pkg/services/contexthandler"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/web"
cw "github.com/weaveworks/common/middleware"
"gopkg.in/macaron.v1"
)
func Logger(cfg *setting.Cfg) macaron.Handler {
return func(res http.ResponseWriter, req *http.Request, c *macaron.Context) {
func Logger(cfg *setting.Cfg) web.Handler {
return func(res http.ResponseWriter, req *http.Request, c *web.Context) {
start := time.Now()
rw := res.(macaron.ResponseWriter)
rw := res.(web.ResponseWriter)
c.Next()
timeTaken := time.Since(start) / time.Millisecond