Changed collect messages to using JSON format

This commit is contained in:
David Allen 2024-08-22 08:44:32 -06:00
parent 2e036c549d
commit 0454735c70
Signed by: towk
GPG key ID: 793B2924A49B3A3F

View file

@ -6,6 +6,8 @@ package client
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"github.com/rs/zerolog/log"
) )
type SmdClient struct { 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) 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 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) 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 return err
} }