mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 03:51:45 +00:00
accurate and necessary logging only
This commit is contained in:
parent
82e1a2c904
commit
43ad535543
10
main.go
10
main.go
@ -145,9 +145,6 @@ func sendRequest(client *resty.Client, url string, ins []interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug log json data
|
|
||||||
log.Printf("Request: %s\n", string(marshal))
|
|
||||||
|
|
||||||
// Create instructions form data
|
// Create instructions form data
|
||||||
req, content := createInsructions(marshal)
|
req, content := createInsructions(marshal)
|
||||||
if req == nil {
|
if req == nil {
|
||||||
@ -166,9 +163,6 @@ func sendRequest(client *resty.Client, url string, ins []interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print response status
|
|
||||||
log.Printf("Response Status: %s\n", res.Status())
|
|
||||||
|
|
||||||
// Unmarshal response
|
// Unmarshal response
|
||||||
var data Response
|
var data Response
|
||||||
err = json.Unmarshal(res.Body(), &data)
|
err = json.Unmarshal(res.Body(), &data)
|
||||||
@ -178,7 +172,9 @@ func sendRequest(client *resty.Client, url string, ins []interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print response
|
// Print response
|
||||||
log.Printf("Success: %t\n", data.Success)
|
if !data.Success {
|
||||||
|
log.Fatal(errors.New("Remote server responded unsuccessfully!"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user