Skip to content

Commit 5d87780

Browse files
Improve Client class logging
1 parent 3b3d0fa commit 5d87780

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

labelbox/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, api_key=None,
4646
api_key = os.environ[_LABELBOX_API_KEY]
4747
self.api_key = api_key
4848

49-
logging.info("Initializing Labelbox client at '%s'", endpoint)
49+
logger.info("Initializing Labelbox client at '%s'", endpoint)
5050

5151
self.endpoint = endpoint
5252
self.headers = {'Accept': 'application/json',
@@ -98,6 +98,7 @@ def convert_value(value):
9898
response = requests.post(self.endpoint, data=data,
9999
headers=self.headers,
100100
timeout=timeout)
101+
logger.debug("Response: %s", response.text)
101102
except requests.exceptions.Timeout as e:
102103
raise labelbox.exceptions.TimeoutError(str(e))
103104

@@ -159,7 +160,7 @@ def check_errors(keywords, *path):
159160
raise labelbox.exceptions.ApiLimitError(response_msg)
160161

161162
if len(errors) > 0:
162-
logging.warning("Unparsed errors on query execution: %r", errors)
163+
logger.warning("Unparsed errors on query execution: %r", errors)
163164
raise labelbox.exceptions.LabelboxError(
164165
"Unknown error: %s" % str(errors))
165166

0 commit comments

Comments
 (0)