Browse Source

En cours de développement

master
losyme 3 months ago
parent
commit
4844694085
  1. 13
      middleware/middleware.go

13
middleware/middleware.go

@ -60,13 +60,14 @@ func Log(logger Logger) router.Middleware {
"uri", req.URL.RequestURI(),
)
err := next(c)
if err != nil {
logger.Error( //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"Request error",
"id", c.RequestID(),
if err := next(c); err != nil {
logger.Debug( //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"Response",
"request", c.RequestID(),
nil, err,
)
return err
}
logger.Debug( //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ -75,7 +76,7 @@ func Log(logger Logger) router.Middleware {
"status", c.Status,
)
return err
return nil
}
}
}

Loading…
Cancel
Save