Do not log binary data during debug
Do not log binary data during debug logging of a session. Replace the binary data with the string <binary_data> instead. Change-Id: I5184002f3a21c5e0ee510b21b9a7884c8dccd1e3
This commit is contained in:
parent
b27489d40b
commit
9b994205a8
@ -202,6 +202,11 @@ class Session(object):
|
||||
if json:
|
||||
data = self._json.encode(json)
|
||||
if data:
|
||||
if isinstance(data, six.binary_type):
|
||||
try:
|
||||
data = data.decode("ascii")
|
||||
except UnicodeDecodeError:
|
||||
data = "<binary_data>"
|
||||
string_parts.append("-d '%s'" % data)
|
||||
|
||||
logger.debug(' '.join(string_parts))
|
||||
|
Loading…
x
Reference in New Issue
Block a user