fix:add list2json for better display

This commit is contained in:
xucong053
2021-07-13 22:02:27 +08:00
committed by GitHub
parent 6417e38717
commit d0b37f6282

View File

@@ -33,7 +33,7 @@ def get_req_resp_record(resp_obj: Response) -> ReqRespData:
def log_print(req_or_resp, r_type):
msg = f"\n================== {r_type} details ==================\n"
for key, value in req_or_resp.dict().items():
if isinstance(value, dict):
if isinstance(value, dict) or isinstance(value, list):
value = json.dumps(value, indent=4, ensure_ascii=False)
msg += "{:<8} : {}\n".format(key, value)