This commit is contained in:
h z
2024-12-02 18:33:39 +00:00
parent 72807d41c1
commit 83c5662fcb
14 changed files with 236 additions and 48 deletions

9
db/utils.py Normal file
View File

@@ -0,0 +1,9 @@
#db/utils.py
from db import get_db
from db.models.BackendLog import BackendLog
def insert_backend_log(level, message, extra=None):
log_entry = BackendLog(level=level, message=message, extra=extra)
with get_db() as db:
db.add(log_entry)
db.commit()