From 44232ab042a090f09bf252c210a1ffa19b46d5f7 Mon Sep 17 00:00:00 2001 From: kimqjin Date: Fri, 11 Oct 2024 11:18:29 +1100 Subject: [PATCH] add addtional debug log --- segment/analytics/request.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/segment/analytics/request.py b/segment/analytics/request.py index 1f5a56e..d751e1f 100644 --- a/segment/analytics/request.py +++ b/segment/analytics/request.py @@ -59,6 +59,11 @@ def post(write_key, host=None, gzip=False, timeout=15, proxies=None, oauth_manag if res.status_code == 200: log.debug('data uploaded successfully') + try: + data = res.json() + log.debug('received response: %s', data) + except ValueError: + log.error('Unknown error: [%s] %s', res.status_code, res.reason) return res if oauth_manager and res.status_code in [400, 401, 403]: