Вывод xml-ответов при использовании loglevel.DEBUG
This commit is contained in:
parent
4e9bdf4de7
commit
a79911619f
1 changed files with 2 additions and 1 deletions
3
main.py
3
main.py
|
|
@ -394,7 +394,8 @@ if __name__ == '__main__':
|
|||
|
||||
def response_hook(resp, *_args, **_kwargs):
|
||||
if logging.root.isEnabledFor(logging.DEBUG):
|
||||
if 'application/json' in resp.headers['Content-Type']:
|
||||
target_headers = ['application/json', 'text/xml']
|
||||
if any(h in resp.headers['Content-Type'] for h in target_headers):
|
||||
logging.debug(resp.text)
|
||||
time.sleep(args.delay)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue