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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user