Refined logs with ChatGPT help
This commit is contained in:
@@ -14,6 +14,12 @@ def buildLog (action, outputs, response):
|
||||
|
||||
if action.showstatus is True and response.ok:
|
||||
print(f"{action.name} successful")
|
||||
try:
|
||||
response_data = response.json()
|
||||
except ValueError:
|
||||
response_data = response.text
|
||||
|
||||
print(response_data)
|
||||
|
||||
elif action.showstatus is True and not response.ok:
|
||||
print(f"{action.name} failed with status code {response.status_code}")
|
||||
|
||||
Reference in New Issue
Block a user