diff options
author | 2021-03-15 02:10:37 +0300 | |
---|---|---|
committer | 2021-03-15 02:16:28 +0300 | |
commit | 7c46099b98bc23e373d78c3ff9739a6a26deb78a (patch) | |
tree | 630e5838814eba27f4e7b51ea5fbcfbdad17beee /backend/discord.py | |
parent | Adds Logging Support (diff) |
Adds Logging To Helpers
Adds logging to the CORS setup, user, and discord helpers. Log
statements have been setup in a way to maximize information for local
development and prod debugging, while minimizing average load on the
prod version.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend/discord.py')
-rw-r--r-- | backend/discord.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/discord.py b/backend/discord.py index 8cb602c..5a4e0fb 100644 --- a/backend/discord.py +++ b/backend/discord.py @@ -1,4 +1,6 @@ """Various utilities for working with the Discord API.""" +import logging + import httpx from backend.constants import ( @@ -7,8 +9,11 @@ from backend.constants import ( API_BASE_URL = "https://discord.com/api/v8" +logger = logging.getLogger(__name__) + async def fetch_bearer_token(code: str, redirect: str, *, refresh: bool) -> dict: + logger.debug(f"Fetching bearer token with code: {code}") async with httpx.AsyncClient() as client: data = { "client_id": OAUTH2_CLIENT_ID, |