This commit is contained in:
h z
2024-12-02 19:50:34 +00:00
parent 83c5662fcb
commit 5557b3434b
7 changed files with 94 additions and 15 deletions

View File

@@ -1,9 +1,7 @@
#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)
def insert_log(log_entry):
with get_db() as db:
db.add(log_entry)
db.commit()