Skip to content

Commit

Permalink
Merge pull request #27 from cuda-networks/improve_logging
Browse files Browse the repository at this point in the history
removed noisy log, changed duplicate sentry to warning log
  • Loading branch information
alexeyts authored Sep 19, 2018
2 parents 80d5782 + a87b50d commit beddc96
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions eb_sqs/worker/service.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
from __future__ import absolute_import, unicode_literals

from datetime import timedelta, datetime

import boto3
import logging

from botocore.config import Config
from botocore.exceptions import ClientError
from datetime import timedelta
from django.utils import timezone

from eb_sqs import settings
from eb_sqs.worker.worker import Worker
from eb_sqs.worker.worker_exceptions import ExecutionFailedException
from eb_sqs.worker.worker_factory import WorkerFactory

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -55,7 +54,7 @@ def process_queues(self, queue_names):
timezone.now() - timedelta(seconds=settings.REFRESH_PREFIX_QUEUES_S) > last_update_time:
queues = static_queues + self.get_queues_by_prefixes(sqs, queue_prefixes)
last_update_time = timezone.now()
logger.info('[django-eb-sqs] Updated SQS queues: {}'.format(
logger.debug('[django-eb-sqs] Updated SQS queues: {}'.format(
', '.join([queue.url for queue in queues])
))

Expand Down Expand Up @@ -119,6 +118,8 @@ def process_message(self, msg, worker):

worker.execute(msg.body)
logger.debug('[django-eb-sqs] Processed message {}'.format(msg.message_id))
except ExecutionFailedException as exc:
logger.warning('[django-eb-sqs] Handling message {} got error: {}'.format(msg.message_id, repr(exc)))
except Exception as exc:
logger.error('[django-eb-sqs] Unhandled error: {}'.format(exc), exc_info=1)

Expand Down

0 comments on commit beddc96

Please sign in to comment.