Add Windows/FreeBSD support

This commit is contained in:
Rob Napier
2014-04-23 14:21:11 -04:00
parent b73d08314f
commit d32bfc962c
6 changed files with 92 additions and 4 deletions
+1 -4
View File
@@ -2,11 +2,8 @@ package logrus
import (
"fmt"
"os"
"sort"
"strings"
"github.com/burke/ttyutils"
)
const (
@@ -25,7 +22,7 @@ type TextFormatter struct {
func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
var serialized []byte
if f.ForceColors || ttyutils.IsTerminal(os.Stdout.Fd()) {
if f.ForceColors || IsTerminal() {
levelText := strings.ToUpper(entry.Data["level"].(string))[0:4]
levelColor := blue