mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Log response content
This commit is contained in:
parent
3d03658850
commit
5aa323e3e5
@ -137,14 +137,15 @@ logger = logging.getLogger(__name__)
|
|||||||
def log_request(request: httpx.Request):
|
def log_request(request: httpx.Request):
|
||||||
logger.debug(f"--> {request.method} {request.url}")
|
logger.debug(f"--> {request.method} {request.url}")
|
||||||
if request.content:
|
if request.content:
|
||||||
for line in request.content.splitlines():
|
logger.debug(f"--> {request.content}")
|
||||||
logger.debug(line)
|
|
||||||
|
|
||||||
|
|
||||||
def log_response(response: httpx.Response, duration: float):
|
def log_response(response: httpx.Response, duration: float):
|
||||||
request = response.request
|
request = response.request
|
||||||
duration_ms = int(1000 * duration)
|
duration_ms = int(1000 * duration)
|
||||||
logger.debug(f"<-- {request.method} {request.url} HTTP {response.status_code} {duration_ms}ms")
|
logger.debug(f"<-- {request.method} {request.url} HTTP {response.status_code} {duration_ms}ms")
|
||||||
|
if response.content:
|
||||||
|
logger.debug(f"<-- {response.content}")
|
||||||
|
|
||||||
|
|
||||||
def gql_post(query: str):
|
def gql_post(query: str):
|
||||||
|
Loading…
Reference in New Issue
Block a user