Merge pull request #53 from OpenCHAMI/minor-changes

Change collect messages to use JSON format
This commit is contained in:
David Allen 2024-08-22 08:46:31 -06:00 committed by GitHub
commit 904d157a61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}