1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-05 00:58:47 +02:00

Bumped to v1.3

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-12-01 11:22:45 -08:00
parent f54cdd86d0
commit 9650c39055
13 changed files with 86 additions and 68 deletions

View File

@ -6,7 +6,6 @@ import (
"github.com/labstack/echo"
"github.com/labstack/gommon/color"
"github.com/labstack/gommon/log"
)
func Logger() echo.MiddlewareFunc {
@ -14,6 +13,7 @@ func Logger() echo.MiddlewareFunc {
return func(c *echo.Context) error {
req := c.Request()
res := c.Response()
logger := c.Echo().Logger()
remoteAddr := req.RemoteAddr
if ip := req.Header.Get(echo.XRealIP); ip != "" {
@ -47,7 +47,7 @@ func Logger() echo.MiddlewareFunc {
code = color.Cyan(n)
}
log.Info("%s %s %s %s %s %d", remoteAddr, method, path, code, stop.Sub(start), size)
logger.Info("%s %s %s %s %s %d", remoteAddr, method, path, code, stop.Sub(start), size)
return nil
}
}