X-Git-Url: https://apps.delaporte.us/gitweb/matrix-fridge-bot.git/blobdiff_plain/e67917d7b50cb915c0189ea8728855fdd5e9a414..f49763fc89fd5263122625962aa022f0c844c346:/matrix_fridge_bot/db.py 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):