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):
|
||||
logger.debug(f"--> {request.method} {request.url}")
|
||||
if request.content:
|
||||
for line in request.content.splitlines():
|
||||
logger.debug(line)
|
||||
logger.debug(f"--> {request.content}")
|
||||
|
||||
|
||||
def log_response(response: httpx.Response, duration: float):
|
||||
request = response.request
|
||||
duration_ms = int(1000 * duration)
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user