From 226d894257fcaef83eac8b7d03b9b8897d75337b Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 21 Jan 2014 15:15:28 -0500 Subject: [PATCH] Prefix apple-specific APNS logs with APNS: (imported from commit 2fa866b3a626c3e42f340bc68e8bc27aef6fd521) --- zerver/lib/push_notifications.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py index dea2d1eb74..10a38684bb 100644 --- a/zerver/lib/push_notifications.py +++ b/zerver/lib/push_notifications.py @@ -43,27 +43,27 @@ def send_apple_push_notification(user, alert, **extra_data): tokens = [b64_to_hex(device.token) for device in PushDeviceToken.objects.filter(user=user, kind=PushDeviceToken.APNS)] - logging.info("Sending apple push notification to devices: %s" % (tokens,)) + logging.info("APNS: Sending apple push notification to devices: %s" % (tokens,)) message = Message(tokens, alert=alert, **extra_data) apns_client = APNs(connection) ret = apns_client.send(message) if not ret: - logging.warning("Failed to send push notification for clients %s" % (tokens,)) + logging.warning("APNS: Failed to send push notification for clients %s" % (tokens,)) return for token, reason in ret.failed.items(): code, errmsg = reason - logging.warning("Failed to deliver APNS notification to %s, reason: %s" % (token, errmsg)) + logging.warning("APNS: Failed to deliver APNS notification to %s, reason: %s" % (token, errmsg)) # Check failures not related to devices. for code, errmsg in ret.errors: - logging.warning("Unknown error when delivering APNS: %s" % (errmsg,)) + logging.warning("APNS: Unknown error when delivering APNS: %s" % (errmsg,)) if ret.needs_retry(): # TODO handle retrying by potentially scheduling a background job # or re-queueing - logging.warning("APNS delivery needs a retry but ignoring") + logging.warning("APNS: delivery needs a retry but ignoring") # NOTE: This is used by the check_apns_tokens manage.py command. Do not call it otherwise, as the # feedback() call can take up to 15s