fix(pterodactyl): add more verbose debug logging

This commit is contained in:
SeaswimmerTheFsh 2024-02-29 16:58:19 -05:00
parent ee6e900e7d
commit e12ded9d42
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -115,8 +115,9 @@ class Pterodactyl(commands.Cog):
regex = await self.config.chat_regex()
match: Optional[re.Match[str]] = re.match(regex, text)
if match:
self.logger.debug("Message is a chat message")
return {"time": match.group(1), "username": match.group(2), "message": match.group(3)}
dict = {"time": match.group(1), "username": match.group(2), "message": match.group(3)}
self.logger.debug("Message is a chat message\n%s", json.dumps(dict))
return dict
self.logger.debug("Message is not a chat message")
return False
@ -126,7 +127,7 @@ class Pterodactyl(commands.Cog):
async with aiohttp.ClientSession() as session:
async with session.get(f"https://playerdb.co/api/player/{endpoint}/{username}") as response:
if response.status == 200:
self.logger.debug("Player info retrieved for %s", username)
self.logger.debug("Player info retrieved for %s\n%s", username, json.dumps(await response.json()))
return await response.json()
else:
self.logger.error("Failed to retrieve player info for %s: %s", username, response.status)