From 8e581e80cbffdf7f061166f78a4bcd7dd4b3628e Mon Sep 17 00:00:00 2001 From: Michael Butkovic Date: Fri, 10 Jun 2016 11:11:30 -0500 Subject: [PATCH] add more logging to IA requests --- bulbs/content/models.py | 6 ++++-- bulbs/content/tasks.py | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bulbs/content/models.py b/bulbs/content/models.py index 67d297a6..ca1878af 100644 --- a/bulbs/content/models.py +++ b/bulbs/content/models.py @@ -632,10 +632,12 @@ def delete_from_instant_article_api(sender, instance=None, **kwargs): Error in deleting Instant Article.\n Content ID: {0}\n IA ID: {1}\n - Status Code: {2}'''.format( + Status Code: {2} + Request: {3}'''.format( instance.id, instance.instant_article_id, - delete.status_code)) + delete.status_code, + delete.__dict__)) else: status = delete.json().get('success') if bool(status) is not True: diff --git a/bulbs/content/tasks.py b/bulbs/content/tasks.py index ee5bb3f4..2758a73f 100644 --- a/bulbs/content/tasks.py +++ b/bulbs/content/tasks.py @@ -90,10 +90,12 @@ def post_article(content, body, fb_page_id, fb_api_url, fb_token_path, fb_dev_mo Error in posting Instant Article.\n Content ID: {0}\n IA ID: {1}\n - Status Code: {2}'''.format( + Status Code: {2} + Request: {3}'''.format( content.id, content.instant_article_id, - post.status_code)) + post.status_code, + post.__dict__)) return # Poll for status of article @@ -113,10 +115,12 @@ def post_article(content, body, fb_page_id, fb_api_url, fb_token_path, fb_dev_mo Error in getting status of Instant Article.\n Content ID: {0}\n IA ID: {1}\n - Status Code: {2}'''.format( + Status Code: {2} + Request: {3}'''.format( content.id, content.instant_article_id, - status.status_code)) + status.status_code, + status.__dict__)) return response = status.json().get('status') @@ -143,10 +147,12 @@ def delete_article(content, fb_api_url, fb_token_path): Error in deleting Instant Article.\n Content ID: {0}\n IA ID: {1}\n - Status Code: {2}'''.format( + Status Code: {2} + Request: {3}'''.format( content.id, content.instant_article_id, - delete.status_code)) + delete.status_code, + delete.__dict__)) else: status = delete.json().get('success') if bool(status) is not True: