include shard id in logging
@@ -22,8 +22,8 @@ def villager_bot_intents() -> discord.Intents:
)
-def setup_logging() -> logging.Logger:
- logging.basicConfig(level=logging.INFO, format="%(levelname)s:%(name)s: %(message)s")
+def setup_logging(shard_id: int) -> logging.Logger:
+ logging.basicConfig(level=logging.INFO, format=f"%(levelname)s:%(name)s [{str(shard_id).rjust(2, '0')}]: %(message)s")
# logging.getLogger("asyncio").setLevel(logging.WARNING) # hide annoying asyncio info
# logging.getLogger("discord.gateway").setLevel(logging.WARNING) # hide annoying gateway info
return logging.getLogger("main")
