You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more important when sending the recovery log output through something like zerolog, where the color codes just end up being escape codes inside some other string and have no hope of being rendered.
The text was updated successfully, but these errors were encountered:
tkgalk
pushed a commit
to tkgalk/gin
that referenced
this issue
Oct 1, 2020
I have a naive solution to this which works fine but unexports the ConsoleColorMode variable. A more proper solution would be to provide a Logger inside the Recovery as only Logger has Color/Non-Color support.
Description
Recovery middleware does not obey
gin.DisableConsoleColor()
, but instead has hard coded ansi color sequences always included in its outputHow to reproduce
Expectations
Expect logged panic output to not have color codes.
Actual result
Logged panic has color codes.
Environment
Additional Information
https://github.com/gin-gonic/gin/blob/master/recovery.go#L54 -- this should be using
gin.IsOutputColor
to determine whether to include color codes in the logger prefixThis is more important when sending the recovery log output through something like
zerolog
, where the color codes just end up being escape codes inside some other string and have no hope of being rendered.The text was updated successfully, but these errors were encountered: