From 37a6e3307d3dff3314fb621b4cafe10770f7646e Mon Sep 17 00:00:00 2001 From: Bradley Jones Date: Fri, 1 Sep 2023 00:31:26 +0100 Subject: [PATCH] chore: change log level of error responses to Harbor requests to Info Signed-off-by: Bradley Jones --- pkg/http/api/v1/handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/http/api/v1/handler.go b/pkg/http/api/v1/handler.go index a8d6bce..c863eb5 100644 --- a/pkg/http/api/v1/handler.go +++ b/pkg/http/api/v1/handler.go @@ -231,7 +231,8 @@ func (h *APIHandler) GetHarborVulnerabilityReport( scanId string, includeFullDescriptions bool, ) (harbor.VulnerabilityReport, error) { - log.WithFields(log.Fields{"scanId": scanId, "includeFullDescriptions": includeFullDescriptions}).Info("handling request for harbor vulnerability report") + log.WithFields(log.Fields{"scanId": scanId, "includeFullDescriptions": includeFullDescriptions}). + Info("handling request for harbor vulnerability report") report, err := h.scanner.GetHarborVulnerabilityReport(scanId, includeFullDescriptions) if err != nil { return harbor.VulnerabilityReport{}, err @@ -284,7 +285,7 @@ func SendJsonResponse(res *http.ResponseWriter, obj interface{}, contentType str } func SendErrorResponse(res *http.ResponseWriter, message string, code int) { - log.WithFields(log.Fields{"message": message, "code": code}).Error("returning error response") + log.WithFields(log.Fields{"message": message, "code": code}).Info("returning error response") resp := *res resp.Header().Set(ContentTypeHeader, ErrorResponseMimeType) errResp := harbor.ErrorResponse{Error: harbor.Error{Message: message}}