From 0acbe97b72faf47891a5d7e7a7e38263ca1fcd28 Mon Sep 17 00:00:00 2001 From: James Dearlove Date: Sun, 15 Oct 2023 17:11:14 +1000 Subject: [PATCH] Added logging for holidays cog --- uqcsbot/holidays.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uqcsbot/holidays.py b/uqcsbot/holidays.py index d4eaea07..f9044a82 100644 --- a/uqcsbot/holidays.py +++ b/uqcsbot/holidays.py @@ -68,6 +68,9 @@ def get_holidays_from_page(holiday_page: str) -> List[Holiday]: holiday = Holiday(date, description, url) holidays.append(holiday) + if holidays == []: + logging.warn("Failed to get holidays from page.") + return holidays @@ -113,8 +116,11 @@ async def holiday(self): Posts a random celebratory day on #general from https://www.timeanddate.com/holidays/fun/ """ + logging.info("Running daily holiday task") + holiday = get_holiday() if holiday is None: + logging.info("No holiday was found for today") return general_channel = discord.utils.get(