refactor: replace print statements with proper logging (#25773)

This commit is contained in:
-LAN- 2025-09-18 20:35:47 +08:00 • committed by GitHub
commit 4ba1292455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 30 additions and 12 deletions

View file

@ -1,4 +1,5 @@
import json
import logging
import uuid
from typing import Any
@ -23,6 +24,8 @@ from core.rag.datasource.vdb.vector_base import BaseVector
from core.rag.models.document import Document
from extensions.ext_redis import redis_client
logger = logging.getLogger(__name__)
Base = declarative_base() # type: Any
@ -187,8 +190,8 @@ class RelytVector(BaseVector):
delete_condition = chunks_table.c.id.in_(ids)
conn.execute(chunks_table.delete().where(delete_condition))
return True
except Exception as e:
print("Delete operation failed:", str(e))
except Exception:
logger.exception("Delete operation failed for collection %s", self._collection_name)
return False
def delete_by_metadata_field(self, key: str, value: str):