21 lines
562 B
Python
21 lines
562 B
Python
import logging
|
|
|
|
def buildLog (action, outputs, response):
|
|
if hasattr(action, "prints"):
|
|
try:
|
|
for print_name, print_key in action.prints.items():
|
|
print(
|
|
f"{print_name}:",
|
|
f"{outputs[print_key]}",
|
|
)
|
|
|
|
except: (KeyError, TypeError)
|
|
|
|
if action.showstatus is True and response.status_code == 200:
|
|
print(f"{action.name} successful")
|
|
|
|
elif action.showstatus is True and response.status_code != 200:
|
|
print(f"{action.name} failed")
|
|
|
|
return
|