1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-01 22:51:17 +02:00

Total coverage for middleware

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-05-30 10:54:55 -07:00
parent b526a0df5b
commit a9e49e2430
13 changed files with 228 additions and 235 deletions

View File

@@ -15,7 +15,7 @@ func Logger() echo.MiddlewareFunc {
if err := h(c); err != nil {
c.Error(err)
}
end := time.Now()
stop := time.Now()
method := c.Request().Method
path := c.Request().URL.Path
if path == "" {
@@ -34,7 +34,7 @@ func Logger() echo.MiddlewareFunc {
code = color.Cyan(n)
}
log.Printf("%s %s %s %s %d", method, path, code, end.Sub(start), size)
log.Printf("%s %s %s %s %d", method, path, code, stop.Sub(start), size)
return nil
}
}