logging all the things...

This commit is contained in:
Josh Burman
2021-11-02 04:07:15 +00:00
parent 5a2871b102
commit 1c50ad5642
2 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,4 @@
import os, sys, json, time
import os, sys, logging
from services.loft_service import LoftService
from helpers import aws_helper
@ -6,16 +6,20 @@ from helpers import aws_helper
from daemonize import Daemonize
from sqs_listener import SqsListener
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(levelname)s %(asctime)s - %(message)s")
class ServiceListener(SqsListener):
def handle_message(self, body, attributes, messages_attributes):
# gather/manage/process data based on the particular needs
logging.info('Incoming message: %s', body)
service = LoftService(body)
service.process()
# log the things
logging.info('Process complete for %s', service.file_name)
def main():
print("Starting Solver Service (v0.3.2)...")
print("Initializing listener")
logging.info('Starting Solver Service (v0.3.2)...')
listener = ServiceListener(
'measure-development-solver-ingest',
region_name=os.environ['SOLVER_AWS_REGION'],