misc(aurora): add more logging

This commit is contained in:
Seaswimmer 2024-06-04 15:43:15 -04:00
parent fdb96539c3
commit ff66006b8a
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F
2 changed files with 5 additions and 2 deletions

View file

@ -29,10 +29,10 @@ class Change(AuroraBaseModel):
@classmethod
def from_dict(cls, bot: Red, data: dict) -> "Change":
logger.trace("Creating Change from dict (%s): %s", type(data), data)
logger.verbose("Creating Change from dict (%s): %s", type(data), data)
if isinstance(data, str):
data = json.loads(data)
logger.trace("Change data was a string, converted to dict: %s", data)
logger.verbose("Change data was a string, converted to dict: %s", data)
if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta):
hours, minutes, seconds = map(int, data["duration"].split(':'))
duration = timedelta(hours=hours, minutes=minutes, seconds=seconds)

View file

@ -162,6 +162,7 @@ class Moderation(AuroraGuildModel):
@classmethod
def from_dict(cls, bot: Red, data: dict) -> "Moderation":
logger.verbose("Creating Moderation from dict (%s): %s", type(data), data)
return cls(bot=bot, **data)
@classmethod
@ -208,6 +209,8 @@ class Moderation(AuroraGuildModel):
@classmethod
def execute(cls, bot: Red, guild_id: int, query: str, parameters: tuple | None = None, cursor: Cursor | None = None) -> Tuple["Moderation"]:
from ..utilities.database import connect
logger.trace("Executing query: %s", query)
logger.trace("With parameters: %s", parameters)
if not parameters:
parameters = ()
if not cursor: