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)) 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