Terminals on Windows may not have colors

This commit is contained in:
Alexander F Rødseth 2015-05-12 16:31:17 +02:00
parent aaf92c9571
commit 29d30d9f63
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package logrus
import (
"bytes"
"fmt"
"runtime"
"sort"
"strings"
"time"
@ -69,7 +70,8 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
prefixFieldClashes(entry.Data)
isColored := (f.ForceColors || isTerminal) && !f.DisableColors
isColorTerminal := isTerminal && (runtime.GOOS != "windows")
isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors
if f.TimestampFormat == "" {
f.TimestampFormat = DefaultTimestampFormat