backend: logging Axione messages

We log the Axione API requests and responses to improve the debugging
experience. We probably should put that behind a config flag at some point.
This commit is contained in:
Félix Baylac-Jacqué 2022-02-18 19:09:29 +01:00
parent 91d63ecff9
commit ac61343ad4
No known key found for this signature in database
GPG key ID: EFD315F31848DBA4

View file

@ -71,8 +71,14 @@ def query_axione(cfg, body):
timeout=120, timeout=120,
) )
conn.request("POST", "/v3/fai", body, headers=headers) conn.request("POST", "/v3/fai", body, headers=headers)
print("")
print("[+] REQUEST")
print(body)
response = conn.getresponse() response = conn.getresponse()
respData = response.read() respData = response.read()
print("")
print("[+] RESPONSE")
print(respData)
except Exception as e: except Exception as e:
print("Error while querying Axione: ", file=sys.stderr) print("Error while querying Axione: ", file=sys.stderr)
print(str(e), file=sys.stderr) print(str(e), file=sys.stderr)