mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 10:12:32 -05:00
Improve the logging message
This commit is contained in:
@@ -95,7 +95,7 @@ def send_sms_to_provider(self, service_id, notification_id):
|
||||
update_notification_status_by_id(notification.id, 'technical-failure', 'failure')
|
||||
|
||||
current_app.logger.info(
|
||||
"SMS {} sent at {}".format(notification_id, notification.sent_at)
|
||||
"SMS {} sent to provider at {}".format(notification_id, notification.sent_at)
|
||||
)
|
||||
statsd_client.incr("notifications.tasks.send-sms-to-provider")
|
||||
statsd_client.timing("notifications.tasks.send-sms-to-provider.task-time", monotonic() - task_start)
|
||||
@@ -167,7 +167,7 @@ def send_email_to_provider(self, service_id, notification_id, reply_to_addresses
|
||||
update_notification_status_by_id(notification.id, 'technical-failure', 'failure')
|
||||
|
||||
current_app.logger.info(
|
||||
"Email {} created at {} sent at {}".format(notification_id, notification.created_at, notification.sent_at)
|
||||
"Email {} sent to provider at {}".format(notification_id, notification.sent_at)
|
||||
)
|
||||
statsd_client.incr("notifications.tasks.send-email-to-provider")
|
||||
statsd_client.timing("notifications.tasks.send-email-to-provider.task-time", monotonic() - task_start)
|
||||
|
||||
@@ -162,12 +162,8 @@ def send_email(self, service_id, notification_id, encrypted_notification, create
|
||||
notification = encryption.decrypt(encrypted_notification)
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
|
||||
provider = provider_to_use(EMAIL_TYPE, notification_id)
|
||||
|
||||
if not service_allowed_to_send_to(notification['to'], service):
|
||||
current_app.logger.info(
|
||||
"Email {} failed as restricted service".format(notification_id)
|
||||
)
|
||||
current_app.logger.info("Email {} failed as restricted service".format(notification_id))
|
||||
return
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user