-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
IsTerm flag should not be affected by DisableConsoleColor method. #1802
Conversation
magenta = string([]byte{27, 91, 57, 55, 59, 52, 53, 109}) | ||
cyan = string([]byte{27, 91, 57, 55, 59, 52, 54, 109}) | ||
reset = string([]byte{27, 91, 48, 109}) | ||
consoleColorMode = autoColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if ForceConsoleColor
would be called after DisableConsoleColor
?
This change makes the behavior easy understanding and the source code readable.
Codecov Report
@@ Coverage Diff @@
## master #1802 +/- ##
==========================================
+ Coverage 98.64% 98.64% +<.01%
==========================================
Files 41 41
Lines 2145 2146 +1
==========================================
+ Hits 2116 2117 +1
Misses 18 18
Partials 11 11
Continue to review full report at Codecov.
|
About color I think that have only two case:
|
@thinkerou
This PR's purposes are two things.
|
@sairoutine I hope simple. |
This PR does not change this behavior. If the user does not call If the user calls |
Yes, I know. So I hope change it release gin1.4 before. do you think? thanks! |
@thinkerou |
@sairoutine I hope the pull request change to:
|
@thinkerou
|
@sairoutine OK, I see #1724 content about |
Thank your for your reviewing! Yes, This PR is related to #1724. |
It is strange behavior that
DisableConsoleColor
turns theIsTerm
flag false.This PR contains the following changes.
IsTerm
represents whether is the output destination console.IsOutputColor
.ForceConsoleColor
andDisableConsoleColor
are called together, Later one is valid.Note
This change breaks backward compability, but
LogFormatterParams
andForceConsoleColor
is not released yet. This change affects only the user which is using master branch.