Skip to content

Commit

Permalink
feat: consolidated logger names (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
telpirion authored Jul 10, 2023
1 parent fd85536 commit ee8ed5b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webhook/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
from vertex_llm import predict_large_language_model
from utils import coerce_datetime_zulu, truncate_complete_text

_FUNCTIONS_GCS_EVENT_LOGGER = "function-triggered-by-storage"
_FUNCTIONS_VERTEX_EVENT_LOGGER = "summarization-by-llm"
_FUNCTIONS_VERTEX_EVENT_LOGGER = 'summarization-by-llm'

_PROJECT_ID = os.environ["PROJECT_ID"]
_OUTPUT_BUCKET = os.environ["OUTPUT_BUCKET"]
Expand Down Expand Up @@ -90,8 +89,10 @@ def entrypoint(request: object) -> dict[str, str]:
def cloud_event_entrypoint(event_id, bucket, name, time_created):
orig_pdf_uri = f"gs://{bucket}/{name}"
logging_client = logging.Client()
logger = logging_client.logger(_FUNCTIONS_GCS_EVENT_LOGGER)
logger.log(f"cloud_event_id({event_id}): UPLOAD {orig_pdf_uri}", severity="INFO")

logger = logging_client.logger(_FUNCTIONS_VERTEX_EVENT_LOGGER)
logger.log(f"cloud_event_id({event_id}): UPLOAD {orig_pdf_uri}",
severity="INFO")

extracted_text = async_document_extract(bucket, name, output_bucket=_OUTPUT_BUCKET)
logger.log(
Expand Down

0 comments on commit ee8ed5b

Please sign in to comment.