From b55cb01fba5b592614fba71e2f3aeab775142d0b Mon Sep 17 00:00:00 2001 From: Lev Date: Sun, 27 Nov 2022 18:38:10 +0700 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20HTTP=20=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D0=BE=D0=B2=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index b862f05..bed339f 100644 --- a/main.py +++ b/main.py @@ -245,8 +245,10 @@ if __name__ == '__main__': logging.basicConfig(format='%(levelname)s -> %(message)s', level=args.log_level.upper()) def response_hook(resp, *_args, **_kwargs): + if logging.root.isEnabledFor(logging.DEBUG): + if 'application/json' in resp.headers['Content-Type']: + logging.debug(resp.text) time.sleep(args.delay) - pass session = Session() session.hooks = {'response': response_hook}