From 3c7d7247a6c7d39c96af3ec38cf498e39fcda523 Mon Sep 17 00:00:00 2001 From: Vasya Aksyonov Date: Fri, 18 Aug 2023 11:20:28 +0300 Subject: [PATCH 1/2] Replaced print with logging --- shopify/resources/graphql.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shopify/resources/graphql.py b/shopify/resources/graphql.py index 33525ef1..c227f6b6 100644 --- a/shopify/resources/graphql.py +++ b/shopify/resources/graphql.py @@ -1,8 +1,12 @@ +import logging + import shopify from ..base import ShopifyResource from six.moves import urllib import json +logger = logging.getLogger(__name__) + class GraphQL: def __init__(self): @@ -27,6 +31,5 @@ def execute(self, query, variables=None, operation_name=None): response = urllib.request.urlopen(req) return response.read().decode("utf-8") except urllib.error.HTTPError as e: - print((e.read())) - print("") + logger.exception("GraphQL error response:\n%s" % e.read()) raise e From c6bbbd900ca19dca6f2375a34c2968972b33efaf Mon Sep 17 00:00:00 2001 From: Vasya Aksyonov Date: Fri, 18 Aug 2023 11:25:46 +0300 Subject: [PATCH 2/2] Changelog --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 868d99c1..5c7f17fe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ == Unreleased +- Replace `print` with `logging` ([#678](https://github.com/Shopify/shopify_python_api/issues/678)) + == Version 12.3.0 - Update API version with 2023-04 release ([#649](https://github.com/Shopify/shopify_python_api/pull/649))