From af9d545893db51f0257b1f7b068411858553420b Mon Sep 17 00:00:00 2001 From: Matt Price Date: Wed, 13 Aug 2014 13:30:25 -0400 Subject: [PATCH] can completely disable colors on text formatter --- text_formatter.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/text_formatter.go b/text_formatter.go index d71eba1..114723d 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -26,7 +26,8 @@ func miniTS() int { type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool + ForceColors bool + DisableColors bool } func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { @@ -34,7 +35,7 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { prefixFieldClashes(entry) - if f.ForceColors || IsTerminal() { + if (f.ForceColors || IsTerminal()) && !DisableColors { levelText := strings.ToUpper(entry.Data["level"].(string))[0:4] levelColor := blue