1
0
mirror of https://github.com/labstack/echo.git synced 2026-05-16 09:48:24 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-04-24 15:13:06 -07:00
parent bb206605da
commit eee38a6376
5 changed files with 32 additions and 11 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package middleware
import (
"log"
"net/http"
"time"
"github.com/labstack/echo"
@@ -12,7 +13,7 @@ func Logger(h echo.HandlerFunc) echo.HandlerFunc {
return func(c *echo.Context) error {
start := time.Now()
if err := h(c); err != nil {
c.Error(err)
c.Error(http.StatusInternalServerError, err)
}
end := time.Now()
m := c.Request.Method