From: Edward Delaporte Date: Wed, 15 Apr 2026 17:46:52 +0000 (-0500) Subject: Logging during invoke X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-goal-bot.git/commitdiff_plain/93786fa2f6de5c71bf24c8587569100f8f7cfb31?ds=sidebyside Logging during invoke --- diff --git a/matrix_goal_bot/db.py b/matrix_goal_bot/db.py index 533b684..a746c59 100644 --- a/matrix_goal_bot/db.py +++ b/matrix_goal_bot/db.py @@ -135,8 +135,9 @@ class Data(): '''List current goals''' with Session(self.engine) as session: cmd = select(Goal).where(Goal.complete_date == None).where(Goal.start_date <= today()) - # cmd = select(Goal).where(Goal.complete_date == None) - return session.exec(cmd).all() + results = session.exec(cmd).all() + logger.debug(f'Current goals: {results}') + return results def get_done_goals(self): '''List completed goals''' diff --git a/tasks.py b/tasks.py index 2132e51..29d9f5b 100644 --- a/tasks.py +++ b/tasks.py @@ -1,5 +1,11 @@ +import logging + from invoke import Collection from matrix_goal_bot import tasks +logging.basicConfig(filename='matrix-goal-bot.log', encoding='utf-8', level=logging.DEBUG) +logging.getLogger('nio').setLevel(logging.WARNING) +logging.getLogger('asyncio').setLevel(logging.WARNING) + ns = Collection() ns.add_collection(tasks, 'goals')