Proper argparse and better logging system

This commit is contained in:
DevilXD committed 2021-12-16 19:06:59 +01:00
1 parent 2d63b24c8f
commit 39363a0aee
5 files changed
+84 -47

No files matched your search

+3 -3
View File
@@ -21,7 +21,6 @@ from constants import (
JsonType,
WebsocketTopic,
CLIENT_ID,
DEBUG_RAW,
USER_AGENT,
COOKIES_PATH,
AUTH_URL,
@@ -34,6 +33,7 @@ from constants import (
logger = logging.getLogger("TwitchDrops")
gql_logger = logging.getLogger("TwitchDrops.gql")
class Twitch:
@@ -417,10 +417,10 @@ class Twitch:
"Authorization": f"OAuth {self._access_token}",
"Client-Id": CLIENT_ID,
}
logger.log(DEBUG_RAW, f"GQL Request: {op}")
gql_logger.debug(f"GQL Request: {op}")
async with self._session.post(GQL_URL, json=op, headers=headers) as response:
response_json = await response.json()
logger.log(DEBUG_RAW, f"GQL Response: {response_json}")
gql_logger.debug(f"GQL Response: {response_json}")
return response_json
async def get_inventory(self) -> List[DropsCampaign]: