Disable colored output on windows entirely
Currently the textformatter on windows outputs ``←[31mERRO←[0m[0000] test windows`` when coloring is not disabled explicitly. However, windows up to windows 8.1 does not support colored output on cmd entirely. Windows 10 added support for it, which is off by default and has to be enabled via registry or environment variable. Therefore i suggest removing colored output on windows entirely to make the output usable again.
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -102,7 +103,7 @@ func (f *TextFormatter) isColored() bool {
|
||||
}
|
||||
}
|
||||
|
||||
return isColored && !f.DisableColors
|
||||
return isColored && !f.DisableColors && (runtime.GOOS != "windows")
|
||||
}
|
||||
|
||||
// Format renders a single log entry
|
||||
|
||||
Reference in New Issue
Block a user