From: Edward Delaporte Date: Tue, 5 May 2026 03:11:46 +0000 (-0500) Subject: Add debug logs X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-fridge-bot.git/commitdiff_plain/a0a644d988ae03268ac2e40009fd730b1fd807a5?ds=inline Add debug logs --- diff --git a/matrix_fridge_bot/db.py b/matrix_fridge_bot/db.py index ceb0872..eb414a4 100644 --- a/matrix_fridge_bot/db.py +++ b/matrix_fridge_bot/db.py @@ -6,7 +6,7 @@ from datetime import timedelta from sqlmodel import Field, Session, SQLModel, create_engine, select, text ## Todo List -# - [ ] add to fridge +# - [x] add to fridge # - [ ] reminder to eat recent food # - [ ] reminder to toss old food @@ -20,6 +20,9 @@ def today(): logger = logging.getLogger(__name__) logging.basicConfig(filename=f'matrix-{MODULE}-bot.log', encoding='utf-8', level=logging.DEBUG) +logging.getLogger('nio').setLevel(logging.WARNING) +logging.getLogger('asyncio').setLevel(logging.WARNING) +logging.getLogger('invoke').setLevel(logging.WARNING) class Food(SQLModel, table=True): id: int | None = Field(default=None, primary_key=True) @@ -34,6 +37,7 @@ class Data(): def __init__(self, db_file): self.file = db_file + logger.debug(f'DB file: {db_file}') self.engine = self.get_engine() def get_db_file(self):