-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [Bug]: Logger Middleware: Enabling color changes padding for some fields #2604
Comments
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Personally I can live with the 7 character padding on the method type because it makes sense for "pretty printing" to ensure a constant width for all possible values. But the single extra spaces on each side really threw me off. There's currently no way for me to remove that space and keep the colours on. I don't think having that spacing makes much sense, if people want an extra space either side they can just add it to their format string like: |
@JShorthouse are we looking to remove the extra spacing or add extra spaces when |
I think removing the spacing would make more sense |
The colourization code for
{method}
and{status}
formats the value and adds extra padding either side. This padding is not added when colorization is disabled.fiber/middleware/logger/tags.go
Lines 176 to 189 in 8ec7cec
This discrepency is immediately obvious when using a custom format that puts these values in brackets, e.g:
With
DisableColours: false
:DisableColours: true
:The text was updated successfully, but these errors were encountered: