Skip to content

Commit 1b61ced

Browse files
committed
Replace pprint with pformat when logging errors
1 parent ff41339 commit 1b61ced

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

blackduck/Client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import json
1313
import logging
1414
import os
15-
from pprint import pprint
15+
from pprint import pformat
1616
import requests.packages.urllib3
1717
from requests.packages.urllib3.util.retry import Retry
1818
from requests.adapters import HTTPAdapter
@@ -143,7 +143,7 @@ def list_resources(self, parent=None):
143143
rel_href_pairs = iter(obj)
144144
except TypeError:
145145
logger.error("unable to list resources on parent object (missing ['_meta']['links']):")
146-
pprint(parent)
146+
logger.error(pformat(parent))
147147
raise
148148
resources_dict = {}
149149
for res in rel_href_pairs:
@@ -175,7 +175,7 @@ def get_resource(self, name, parent=None, items=True, **kwargs):
175175
if name not in resources_dict:
176176
msg = f"resource name '{name}' not found in available resources"
177177
logger.error(msg)
178-
pprint(resources_dict)
178+
logger.error(pformat(resources_dict))
179179
raise KeyError(msg)
180180
url = resources_dict[name]
181181

0 commit comments

Comments
 (0)