From 4b0d855eb0355dead2da0d9eaa48980fea6ebf65 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Sun, 25 Jan 2015 17:13:03 +0000 Subject: [PATCH] Log received JSON as a single line to avoid spamming logs too much --- tipbot/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tipbot/utils.py b/tipbot/utils.py index f9ca431..0917ee7 100644 --- a/tipbot/utils.py +++ b/tipbot/utils.py @@ -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: