1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-17 01:43:02 +02:00

Enhanced recover middleware

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-03-14 13:55:38 -07:00
parent 0465314380
commit 00bf0d651f
6 changed files with 99 additions and 40 deletions

View File

@ -9,11 +9,19 @@ import (
)
type (
LoggerOptions struct {
LoggerConfig struct {
}
)
func Logger(options ...LoggerOptions) echo.MiddlewareFunc {
var (
DefaultLoggerConfig = LoggerConfig{}
)
func Logger() echo.MiddlewareFunc {
return LoggerFromConfig(DefaultLoggerConfig)
}
func LoggerFromConfig(config LoggerConfig) echo.MiddlewareFunc {
return func(next echo.Handler) echo.Handler {
return echo.HandlerFunc(func(c echo.Context) error {
req := c.Request()