From 6d34e23815eb6cf8cb4d0a1748a1c033e592df32 Mon Sep 17 00:00:00 2001 From: Akarshit Joshi <46246540+AKARSHITJOSHI@users.noreply.github.com> Date: Mon, 11 Sep 2023 12:15:00 +0530 Subject: [PATCH] [Bug]: Logger Middleware: Enabling color changes padding for some fields #2604 (#2616) :bug: Removes extra padding for response code, method --- middleware/logger/tags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/logger/tags.go b/middleware/logger/tags.go index af114a5777..87b9a9b228 100644 --- a/middleware/logger/tags.go +++ b/middleware/logger/tags.go @@ -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()) },