Make logging more efficient in transport
Currently, transport does all the string format work on the request and then it tries to log it without checking first if it is even going to print. This is low enough level code that it should be more efficient. Change-Id: I12ec7fe7488252c3b02c246179cdd7c1cf136716
This commit is contained in:
@@ -203,6 +203,9 @@ class Transport(requests.Session):
|
||||
return resp
|
||||
|
||||
def _log_request(self, method, url, **kwargs):
|
||||
if not _logger.isEnabledFor(logging.DEBUG):
|
||||
return
|
||||
|
||||
if 'params' in kwargs and kwargs['params']:
|
||||
url += '?' + urllib.parse.urlencode(kwargs['params'])
|
||||
|
||||
|
Reference in New Issue
Block a user