Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abb50d71b4 | ||
|
|
7409e2fd2d |
@@ -44,10 +44,10 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
|
|||||||
an active election, runs the check_date() function for the election to perform actions. Finally checks if the
|
an active election, runs the check_date() function for the election to perform actions. Finally checks if the
|
||||||
election is over to delete the current election object.
|
election is over to delete the current election object.
|
||||||
"""
|
"""
|
||||||
dakiny_logger.debug("Daily loop.")
|
dakiny_logger.debug("Daily loop. Current election: %s.", self.current_election)
|
||||||
if self.current_election is None:
|
if self.current_election is None:
|
||||||
self.current_election = self.get_election()
|
self.current_election = self.get_election()
|
||||||
dakiny_logger.debug("Current election: %s", self.current_election)
|
dakiny_logger.debug("Current election: %s.", self.current_election)
|
||||||
|
|
||||||
if self.current_election is not None:
|
if self.current_election is not None:
|
||||||
await self.current_election.check_date()
|
await self.current_election.check_date()
|
||||||
@@ -81,9 +81,11 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
|
|||||||
Election: Current election cycle, None if there is no election happening.
|
Election: Current election cycle, None if there is no election happening.
|
||||||
"""
|
"""
|
||||||
cycle = get_active_election_cycle()
|
cycle = get_active_election_cycle()
|
||||||
|
dakiny_logger.debug("Current cycle: %s.", cycle)
|
||||||
|
|
||||||
# prevent exception from using cycle as an Int in an array
|
# prevent exception from using cycle as an Int in an array
|
||||||
if cycle is None:
|
if cycle is None:
|
||||||
|
dakiny_logger.info("Cycle was None. Returning without an election.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
election = Election(cycle, self.bot.get_guild(settings.params.guild_id))
|
election = Election(cycle, self.bot.get_guild(settings.params.guild_id))
|
||||||
|
|||||||
@@ -7,5 +7,7 @@ import sys
|
|||||||
dakiny_logger = logging.getLogger("default")
|
dakiny_logger = logging.getLogger("default")
|
||||||
dakiny_logger.setLevel(logging.DEBUG if os.getenv("DEBUG") == "true" else logging.INFO)
|
dakiny_logger.setLevel(logging.DEBUG if os.getenv("DEBUG") == "true" else logging.INFO)
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
handler = logging.StreamHandler(sys.stdout)
|
||||||
handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
|
handler.setFormatter(
|
||||||
|
logging.Formatter("%(asctime)s:%(levelname)s [%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s")
|
||||||
|
)
|
||||||
dakiny_logger.addHandler(handler)
|
dakiny_logger.addHandler(handler)
|
||||||
|
|||||||
Reference in New Issue
Block a user