Skip to content

Commit

Permalink
🩹 Fix: improve what_new.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JIeJaitt committed Mar 4, 2025
1 parent e2295e5 commit 0ac13c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/whats_new.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ The `Filter` is a function that is called before the log string for a request is
app.Use(logger.New(logger.Config{
Filter: func(c fiber.Ctx) bool {
// log status code >= 400
return c.Response().StatusCode() >= fiber.StatusNotFound
return c.Response().StatusCode() >= fiber.StatusBadRequest
},
}))

Expand Down
2 changes: 2 additions & 0 deletions middleware/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ func Test_Logger_Done(t *testing.T) {
require.Positive(t, buf.Len(), 0)
}

// Test_Logger_Filter tests the Filter functionality of the logger middleware.
// It verifies that logs are written or skipped based on the filter condition.
func Test_Logger_Filter(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 0ac13c8

Please sign in to comment.