From 9bc59a596929f70e795b6a59bdf95b8c90cb9a7f Mon Sep 17 00:00:00 2001 From: Felix Kollmann Date: Tue, 3 Apr 2018 04:50:50 +0200 Subject: [PATCH] Fixed initTerminal() was run for non-terminals --- text_formatter.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/text_formatter.go b/text_formatter.go index afd9ffb..c62c412 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -51,7 +51,6 @@ type TextFormatter struct { // be desired. DisableSorting bool - // Disables the truncation of the level text to 4 characters. DisableLevelTruncation bool @@ -68,7 +67,9 @@ func (f *TextFormatter) init(entry *Entry) { if entry.Logger != nil { f.isTerminal = checkIfTerminal(entry.Logger.Out) - f.initTerminal(entry) + if f.isTerminal { + f.initTerminal(entry) + } } }