refactor: replace print statements with logging for better error tracking

This commit is contained in:
Yifang Deng
2025-02-25 15:53:55 +01:00
parent 6fedd72e39
commit 0e5d5ecb81
34 changed files with 171 additions and 103 deletions
+2 -3
View File
@@ -166,7 +166,7 @@ class ModelsTable:
else:
return None
except Exception as e:
print(e)
log.exception(f"Failed to insert a new model: {e}")
return None
def get_all_models(self) -> list[ModelModel]:
@@ -246,8 +246,7 @@ class ModelsTable:
db.refresh(model)
return ModelModel.model_validate(model)
except Exception as e:
print(e)
log.exception(f"Failed to update the model by id {id}: {e}")
return None
def delete_model_by_id(self, id: str) -> bool: