mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
test adding logging
This commit is contained in:
parent
ad9faa8b9d
commit
15233849db
1 changed files with 9 additions and 3 deletions
|
|
@ -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__":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue