From 7ea2af30689a56a027a9e27e6c0b59fafb765ea8 Mon Sep 17 00:00:00 2001 From: Antoine Grondin Date: Sat, 11 Apr 2015 23:06:15 -0400 Subject: [PATCH] json: don't print the msg/time/level in the fields --- json_handler.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/json_handler.go b/json_handler.go index d3c95cb6..03684a8a 100644 --- a/json_handler.go +++ b/json_handler.go @@ -73,6 +73,9 @@ func (h *JSONHandler) UnmarshalJSON(data []byte) error { } h.Level, _ = raw["level"].(string) h.Message, _ = raw["msg"].(string) + delete(raw, "time") + delete(raw, "level") + delete(raw, "msg") if h.Fields == nil { h.Fields = make(map[string]string) @@ -132,10 +135,6 @@ func (h *JSONHandler) Prettify(skipUnchanged bool) []byte { return h.buf.Bytes() } -func (h *JSONHandler) setField(key, val string) { - -} - func (h *JSONHandler) joinKVs(skipUnchanged bool, sep string) []string { kv := make([]string, 0, len(h.Fields))