feat: add proper logging

This commit is contained in:
2025-01-08 08:56:32 -05:00
parent d56bac1b2f
commit e3982c064d
6 changed files with 29 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
import asyncio
import time
from logging import debug, error
import disnake
@@ -7,6 +8,8 @@ from state import client, idle_tracker, players
async def cleanup():
debug("spawned cleanup thread")
while True:
await asyncio.sleep(3600 * 12)
@@ -17,7 +20,7 @@ async def cleanup():
for target in targets:
del players[target]
if __debug__:
print(f"cleanup removed {len(targets)} empty players")
debug(f"cleanup removed {len(targets)} empty players")
if (
not idle_tracker["is_idle"]
@@ -27,4 +30,4 @@ async def cleanup():
await client.change_presence(status=disnake.Status.idle)
idle_tracker["is_idle"] = True
except Exception as e:
print(f"failed to change status to idle: {e}")
error(f"failed to change status to idle: {e}")