File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ func (f *TextFormatter) init(entry *Entry) {
91
91
}
92
92
93
93
func (f * TextFormatter ) isColored () bool {
94
- isColored := f .ForceColors || f .isTerminal
94
+ isColored := f .ForceColors || ( f .isTerminal && ( runtime . GOOS != "windows" ))
95
95
96
96
if f .EnvironmentOverrideColors {
97
97
if force , ok := os .LookupEnv ("CLICOLOR_FORCE" ); ok && force != "0" {
@@ -103,7 +103,7 @@ func (f *TextFormatter) isColored() bool {
103
103
}
104
104
}
105
105
106
- return isColored && ! f .DisableColors && ( runtime . GOOS != "windows" )
106
+ return isColored && ! f .DisableColors
107
107
}
108
108
109
109
// Format renders a single log entry
Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ func TestTextFormatterIsColored(t *testing.T) {
444
444
os .Setenv ("CLICOLOR_FORCE" , val .clicolorForceVal )
445
445
}
446
446
res := tf .isColored ()
447
- if runtime .GOOS == "windows" {
447
+ if runtime .GOOS == "windows" && ! tf . ForceColors && ! val . clicolorForceIsSet {
448
448
assert .Equal (subT , false , res )
449
449
} else {
450
450
assert .Equal (subT , val .expectedResult , res )
You can’t perform that action at this time.
0 commit comments