Skip to content

middleware/logger: respect NoColor in Panic output - #1130

Closed
mayank-dev-15 wants to merge 1 commit into
go-chi:masterfrom
mayank-dev-15:fix-nocolor-panic
Closed

middleware/logger: respect NoColor in Panic output#1130
mayank-dev-15 wants to merge 1 commit into
go-chi:masterfrom
mayank-dev-15:fix-nocolor-panic

Conversation

@mayank-dev-15

Copy link
Copy Markdown

Fixes #1042

defaultLogEntry.Panic() called PrintPrettyStack() which hardcoded useColor := true, ignoring the NoColor field on DefaultLogFormatter.

Added PrintPrettyStackWithColor(rvr, useColor) to accept a color flag, updated defaultLogEntry.Panic() to pass l.useColor, and kept PrintPrettyStack as a wrapper that defaults to rue for backward compatibility.

@VojtechVitek

Copy link
Copy Markdown
Contributor

Hi, #1042 was fixed via #1050 + #1131.

Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

middleware.Logger: defaultLogEntry.Panic() does not respect 'NoColor' of DefaultLogFormatter

2 participants