Log received JSON as a single line to avoid spamming logs too much

This commit is contained in:
moneromooo 2015-01-25 17:13:03 +00:00
parent fb465b70cc
commit 4b0d855eb0
1 changed files with 2 additions and 3 deletions

View File

@ -131,13 +131,12 @@ def SendJSONRPCCommand(host,port,method,params):
http.close()
raise
response = http.getresponse()
log_log('SendJSONRPCCommand: Received reply status: %s' % response.status)
if response.status != 200:
log_error('SendJSONRPCCommand: Error, not 200: %s' % str(response.status))
log_error('SendJSONRPCCommand: Error, received reply status %s' % str(response.status))
http.close()
raise RuntimeError("Error "+response.status)
s = response.read()
log_log('SendJSONRPCCommand: Received reply: %s' % str(s))
log_log('SendJSONRPCCommand: Received reply status %s: %s' % (response.status, str(s).replace('\r\n',' ').replace('\n',' ')))
try:
j = json.loads(s)
except Exception,e: