Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: consolidated logger names #22

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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