Merge pull request #206 from Hestia-Homes/main

test adding logging
This commit is contained in:
KhalimCK 2023-09-01 18:42:06 +01:00 committed by GitHub
commit fa6b2ba638
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,11 @@
import os
import urllib.parse
import logging
from predictions import prediction
logger = logging.getLogger()
logger.setLevel(logging.INFO)
RUNTIME_ENVIRONMENT = os.environ.get("RUNTIME_ENVIRONMENT", "dev")
@ -10,6 +14,8 @@ def handler(event, context):
Take in event and trigger the prediction pipeline
"""
logger.info("received event: " + str(event))
# Assuming a file in a bucket landing for now?
# Assuming we have a model to use
@ -30,8 +36,8 @@ def handler(event, context):
return storage_filepath
except (Exception, KeyError, ValueError) as e:
print("Prediction failed")
print(e)
logger.info("Prediction failed")
logger.info(e)
if __name__ == "__main__":