From a057c865f6d7e50b867b8ddfb3c31e6f36f54e5a Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Sun, 8 Dec 2019 11:47:07 -0500 Subject: [PATCH] Only log errors when its an app error. Otherwise just debug the output. --- swagger/apiserver/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swagger/apiserver/main.go b/swagger/apiserver/main.go index a44685a..bb34dde 100644 --- a/swagger/apiserver/main.go +++ b/swagger/apiserver/main.go @@ -32,9 +32,12 @@ func InitApiServer(hostAndPort string) { hs["Access-Control-Allow-Origin"] = "*" api.ResponseHeaders = hs api.Log = func(request *http.Request, response *api.Response, err error) { - if err != nil { + if response.Status >= http.StatusInternalServerError { logrus.Error(err) } + if err != nil { + logrus.Debug("Error: ", err) + } consoleText := request.RemoteAddr + " [" + strconv.Itoa(response.Status) + "]: " + request.Method + " " + request.URL.Path logrus.Debug(color.GreenString(consoleText))