Skip to content

Commit

Permalink
fix again the fucking http status code
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Jun 30, 2023
1 parent 125cad0 commit bdc469c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func NewWithConfig(logger *slog.Logger, config Config) echo.MiddlewareFunc {
}

switch {
case c.Response().Status >= http.StatusBadRequest && c.Response().Status < http.StatusInternalServerError:
case status >= http.StatusBadRequest && status < http.StatusInternalServerError:
logger.LogAttrs(context.Background(), config.ClientErrorLevel, err.Error(), attributes...)
case c.Response().Status >= http.StatusInternalServerError:
case status >= http.StatusInternalServerError:
logger.LogAttrs(context.Background(), config.ServerErrorLevel, err.Error(), attributes...)
default:
logger.LogAttrs(context.Background(), config.DefaultLevel, "Incoming request", attributes...)
Expand Down

0 comments on commit bdc469c

Please sign in to comment.