diff --git a/text_formatter.go b/text_formatter.go index 78e7889..bbf6110 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -59,12 +59,12 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { printColored(b, entry, keys) } else { if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(time.RFC3339)) + printKeyValue(b, "time", entry.Time.Format(time.RFC3339)) } - f.appendKeyValue(b, "level", entry.Level.String()) - f.appendKeyValue(b, "msg", entry.Message) + printKeyValue(b, "level", entry.Level.String()) + printKeyValue(b, "msg", entry.Message) for _, key := range keys { - f.appendKeyValue(b, key, entry.Data[key]) + printKeyValue(b, key, entry.Data[key]) } } @@ -104,7 +104,7 @@ func needsQuoting(text string) bool { return true } -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key, value interface{}) { +func printKeyValue(b *bytes.Buffer, key, value interface{}) { switch value.(type) { case string: if needsQuoting(value.(string)) {