add logging
This commit is contained in:
parent
41d4934cc1
commit
4d93c22bd2
@ -23,7 +23,7 @@ IMAGE_CONFIG = Config(CONFIG_FILE)
|
||||
LOG_FORMAT = "%(asctime)s [%(levelname)s] - [%(filename)s -> %(funcName)s() -> %(lineno)s] : %(message)s"
|
||||
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
logger = logging.getLogger()
|
||||
logger = logging.getLogger("main")
|
||||
logger.setLevel("DEBUG")
|
||||
|
||||
stream_handler = logging.StreamHandler(sys.stdout)
|
||||
@ -49,6 +49,7 @@ def process_request(request_message):
|
||||
bucket = PYINFRA_CONFIG.storage_bucket
|
||||
storage = get_storage(PYINFRA_CONFIG)
|
||||
|
||||
logger.debug("loading model pipeline")
|
||||
pipeline = load_pipeline(verbose=IMAGE_CONFIG.service.verbose, batch_size=IMAGE_CONFIG.service.batch_size)
|
||||
|
||||
if storage.exists(bucket, target_file_name):
|
||||
@ -66,6 +67,7 @@ def process_request(request_message):
|
||||
classifications_cv = []
|
||||
|
||||
result = {**request_message, "data": classifications, "dataCV": classifications_cv}
|
||||
logger.debug("returning/storing results:\n\t%s", result)
|
||||
storage_bytes = gzip.compress(json.dumps(result).encode("utf-8"))
|
||||
storage.put_object(bucket, response_file_name, storage_bytes)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user