parent
9ba51167b8
commit
e3534a9068
|
@ -35,11 +35,17 @@ func GetTime() string {
|
|||
}
|
||||
|
||||
type LogManagerRequestBody struct {
|
||||
Type string
|
||||
Logs []string
|
||||
Type string // like system, grouptasks, etc
|
||||
Logs []string // array of logs
|
||||
}
|
||||
|
||||
func LogManagerRequestClient(requestMethod string, body interface{}) {
|
||||
const (
|
||||
LogTypeInfo = "I"
|
||||
LogTypeWarning = "W"
|
||||
LogTypeError = "E"
|
||||
)
|
||||
|
||||
func LogManagerRequestClient(requestMethod string, requestBody LogManagerRequestBody) {
|
||||
if usedLogManagerServerUrl == "" {
|
||||
log.Error().Msgf("Log manager server url is not set, skipping request")
|
||||
return
|
||||
|
@ -52,7 +58,7 @@ func LogManagerRequestClient(requestMethod string, body interface{}) {
|
|||
req.SetRequestURI(usedLogManagerServerUrl + "/v1/log")
|
||||
req.Header.SetContentType("application/json")
|
||||
|
||||
reqestBodyBytes, err := json.Marshal(body)
|
||||
reqestBodyBytes, err := json.Marshal(requestBody)
|
||||
|
||||
if err != nil {
|
||||
log.Error().Msgf("Failed to marshal request body, err: %s", err)
|
||||
|
|
Loading…
Reference in New Issue