From 9ca7d9fefe4ee54e2d6f53ea26b84e5d5bc694f0 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Fri, 19 Jun 2015 17:20:59 -0700 Subject: [PATCH] Don't emit a msg if there is none to emit --- text_formatter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/text_formatter.go b/text_formatter.go index 17cc298..06ef202 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -84,7 +84,9 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat)) } f.appendKeyValue(b, "level", entry.Level.String()) - f.appendKeyValue(b, "msg", entry.Message) + if entry.Message != "" { + f.appendKeyValue(b, "msg", entry.Message) + } for _, key := range keys { f.appendKeyValue(b, key, entry.Data[key]) }