Skip to content

Commit

Permalink
Logger info
Browse files Browse the repository at this point in the history
  • Loading branch information
say-yawn committed Aug 5, 2021
1 parent 3a45102 commit 2022c5b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions emails/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def _sns_notification(json_body):
notification_type,
status=400
)

logger.error('Sns Notification', extra={'json_body': json_body})
return _sns_message(message_json)


Expand Down Expand Up @@ -283,12 +283,17 @@ def _sns_message(message_json):
return HttpResponse('noreply address is not supported.')

domain_portion = to_address.split('@')[1]

logger.error('Sns message get address', extra={
'to_address': to_address,
'local_portion': local_portion,
'domain_portion': domain_portion}
)
try:
# FIXME: this ambiguous return of either
# RelayAddress or DomainAddress types makes the Rustacean in me throw
# up a bit.
address = _get_address(to_address, local_portion, domain_portion)
logger.error('Sns message address info', extra={'address': address})
user_profile = address.user.profile_set.first()
except Exception:
return HttpResponse("Address does not exist", status=404)
Expand Down

0 comments on commit 2022c5b

Please sign in to comment.