From 0454735c70ddfa7acfb6ec58ecf12bca75dafd1e Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Thu, 22 Aug 2024 08:44:32 -0600 Subject: [PATCH] Changed collect messages to using JSON format --- pkg/client/smd.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/client/smd.go b/pkg/client/smd.go index a908729..a118460 100644 --- a/pkg/client/smd.go +++ b/pkg/client/smd.go @@ -6,6 +6,8 @@ package client import ( "fmt" "net/http" + + "github.com/rs/zerolog/log" ) type SmdClient struct { @@ -46,7 +48,7 @@ func (c SmdClient) Add(data HTTPBody, headers HTTPHeader) error { return fmt.Errorf("returned status code %d when adding endpoint", res.StatusCode) } } - fmt.Printf("%v (%v)\n%s\n", url, res.Status, string(body)) + log.Debug().Msgf("%v (%v)\n%s\n", url, res.Status, string(body)) } return err } @@ -67,7 +69,7 @@ func (c SmdClient) Update(data HTTPBody, headers HTTPHeader) error { return fmt.Errorf("failed to update redfish endpoint (returned %s)", res.Status) } } - fmt.Printf("%v (%v)\n%s\n", url, res.Status, string(body)) + log.Debug().Msgf("%v (%v)\n%s\n", url, res.Status, string(body)) } return err }