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