logging all the things...
This commit is contained in:
12
app/main.py
12
app/main.py
@ -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'],
|
||||
|
Reference in New Issue
Block a user