Skip to content

Commit

Permalink
Use f-strings in lambda_handler logger
Browse files Browse the repository at this point in the history
Matt rightly pointed out that strings are more readable this
way (and it turns out we're using f-strings in the logger
throughtout the rest of the code base anyway!)
  • Loading branch information
bsweger committed May 7, 2024
1 parent ce8ddae commit 0bee296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions faas/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def lambda_handler(event, context):
logger.info(f"Event type {event_source}:{event_name} is not supported, skipping")
return

logger.info("Transforming file: {}/{}".format(bucket, key))
logger.info(f"Transforming file: {bucket}/{key}")
try:
mo = ModelOutputHandler.from_s3(bucket, key)
mo.transform_model_output()
except Exception as e:
logger.exception("Error transforming file: {}/{}".format(key, bucket))
logger.exception(f"Error transforming file: {bucket}/{key}")
raise e

0 comments on commit 0bee296

Please sign in to comment.