Implement logging strategy (#444)

* Logging strategy and convert all prints() to logging invocations
This commit is contained in:
cybermaggedon 2025-07-30 23:18:38 +01:00 committed by GitHub
parent 3e0651222b
commit dd70aade11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
117 changed files with 1216 additions and 667 deletions

View file

@ -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