mirror of https://github.com/sirupsen/logrus.git
Terminals on Windows may not have colors
This commit is contained in:
parent
aaf92c9571
commit
29d30d9f63
|
@ -3,6 +3,7 @@ package logrus
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -69,7 +70,8 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
|
||||||
|
|
||||||
prefixFieldClashes(entry.Data)
|
prefixFieldClashes(entry.Data)
|
||||||
|
|
||||||
isColored := (f.ForceColors || isTerminal) && !f.DisableColors
|
isColorTerminal := isTerminal && (runtime.GOOS != "windows")
|
||||||
|
isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors
|
||||||
|
|
||||||
if f.TimestampFormat == "" {
|
if f.TimestampFormat == "" {
|
||||||
f.TimestampFormat = DefaultTimestampFormat
|
f.TimestampFormat = DefaultTimestampFormat
|
||||||
|
|
Loading…
Reference in New Issue