Skip to content

Commit

Permalink
[Bug]: Logger Middleware: Enabling color changes padding for some fie…
Browse files Browse the repository at this point in the history
…lds #2604  (#2616)

🐛 Removes extra padding for response code, method
  • Loading branch information
AKARSHITJOSHI authored Sep 11, 2023
1 parent fe65ff8 commit 6d34e23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions middleware/logger/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ func createTagMap(cfg *Config) map[string]LogFunc {
TagStatus: func(output Buffer, c *fiber.Ctx, data *Data, extraParam string) (int, error) {
if cfg.enableColors {
colors := c.App().Config().ColorScheme
return output.WriteString(fmt.Sprintf("%s %3d %s", statusColor(c.Response().StatusCode(), colors), c.Response().StatusCode(), colors.Reset))
return output.WriteString(fmt.Sprintf("%s%3d%s", statusColor(c.Response().StatusCode(), colors), c.Response().StatusCode(), colors.Reset))
}
return appendInt(output, c.Response().StatusCode())
},
TagMethod: func(output Buffer, c *fiber.Ctx, data *Data, extraParam string) (int, error) {
if cfg.enableColors {
colors := c.App().Config().ColorScheme
return output.WriteString(fmt.Sprintf("%s %-7s %s", methodColor(c.Method(), colors), c.Method(), colors.Reset))
return output.WriteString(fmt.Sprintf("%s%s%s", methodColor(c.Method(), colors), c.Method(), colors.Reset))
}
return output.WriteString(c.Method())
},
Expand Down

0 comments on commit 6d34e23

Please sign in to comment.