mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 08:26:21 +02:00
Implement logging strategy (#444)
* Logging strategy and convert all prints() to logging invocations
This commit is contained in:
parent
3e0651222b
commit
dd70aade11
117 changed files with 1216 additions and 667 deletions
|
|
@ -9,9 +9,13 @@ from pinecone.grpc import PineconeGRPC, GRPCClientConfig
|
|||
import time
|
||||
import uuid
|
||||
import os
|
||||
import logging
|
||||
|
||||
from .... base import DocumentEmbeddingsStoreService
|
||||
|
||||
# Module logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
default_ident = "de-write"
|
||||
default_api_key = os.getenv("PINECONE_API_KEY", "not-specified")
|
||||
default_cloud = "aws"
|
||||
|
|
@ -104,10 +108,10 @@ class Processor(DocumentEmbeddingsStoreService):
|
|||
self.create_index(index_name, dim)
|
||||
|
||||
except Exception as e:
|
||||
print("Pinecone index creation failed")
|
||||
logger.error("Pinecone index creation failed")
|
||||
raise e
|
||||
|
||||
print(f"Index {index_name} created", flush=True)
|
||||
logger.info(f"Index {index_name} created")
|
||||
|
||||
self.last_index_name = index_name
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue