Fixed initTerminal() was run for non-terminals

This commit is contained in:
Felix Kollmann 2018-04-03 04:50:50 +02:00
parent cf5eba7dfd
commit 9bc59a5969
1 changed files with 3 additions and 2 deletions

View File

@ -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)
}
}
}