1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-01 22:51:17 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-05-05 21:55:49 -07:00
parent 54d2f72368
commit f80fff4efb
12 changed files with 176 additions and 147 deletions

View File

@@ -2,7 +2,6 @@ package middleware
import (
"log"
"net/http"
"time"
"github.com/labstack/echo"
@@ -10,10 +9,10 @@ import (
)
func Logger(h echo.HandlerFunc) echo.HandlerFunc {
return func(c *echo.Context) error {
return func(c *echo.Context) *echo.HTTPError {
start := time.Now()
if err := h(c); err != nil {
c.Error(http.StatusInternalServerError, err)
if he := h(c); he != nil {
c.Error(he)
}
end := time.Now()
m := c.Request.Method