From a001c9d5c77717ee2aeb6d0f182c84d87cd6e6f5 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 22 Sep 2017 15:59:28 -0400 Subject: [PATCH] Remove unused Format Signed-off-by: Daniel Nephin Upstream-commit: 638d4cc7e4390ab217be711913017b22ce2cd5c2 Component: engine --- components/engine/pkg/jsonlog/jsonlog.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/components/engine/pkg/jsonlog/jsonlog.go b/components/engine/pkg/jsonlog/jsonlog.go index 4734c31119..7b9871ae87 100644 --- a/components/engine/pkg/jsonlog/jsonlog.go +++ b/components/engine/pkg/jsonlog/jsonlog.go @@ -1,8 +1,6 @@ package jsonlog import ( - "encoding/json" - "fmt" "time" ) @@ -19,24 +17,10 @@ type JSONLog struct { Attrs map[string]string `json:"attrs,omitempty"` } -// Format returns the log formatted according to format -// If format is nil, returns the log message -// If format is json, returns the log marshaled in json format -// By default, returns the log with the log time formatted according to format. -func (jl *JSONLog) Format(format string) (string, error) { - if format == "" { - return jl.Log, nil - } - if format == "json" { - m, err := json.Marshal(jl) - return string(m), err - } - return fmt.Sprintf("%s %s", jl.Created.Format(format), jl.Log), nil -} - -// Reset resets the log to nil. +// Reset all fields to their zero value. func (jl *JSONLog) Reset() { jl.Log = "" jl.Stream = "" jl.Created = time.Time{} + jl.Attrs = make(map[string]string) }