From da687134e2dd5fb8a024379ff5ea2b4daccbcc7d Mon Sep 17 00:00:00 2001 From: Carlos Killpack Date: Thu, 20 Jun 2013 12:16:21 -0600 Subject: [PATCH] Updated in reponse to comments in pull/234, changed some more print statements into logger calls --- src/bitmessagemain.py | 9 +++------ src/debug.py | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 0b93cdcf..f00eefad 100644 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -97,10 +97,7 @@ class outgoingSynSender(threading.Thread): sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.settimeout(20) if shared.config.get('bitmessagesettings', 'socksproxytype') == 'none' and verbose >= 2: - #shared.printLock.acquire() - #print 'Trying an outgoing connection to', HOST, ':', PORT logger.info('Trying an outgoing connection to %s:%s' % (HOST, PORT)) - #shared.printLock.release() # sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) elif shared.config.get('bitmessagesettings', 'socksproxytype') == 'SOCKS4a': if verbose >= 2: @@ -1084,7 +1081,7 @@ class receiveDataThread(threading.Thread): return else: logger.info('This was NOT on acknowledgement bound for me.') - # logger.info("Ack data for which I'm watching: %s" % ackdataForWhichImWatching) + logger.debug("Ack data for which I'm watching: %s" % ackdataForWhichImWatching) # This is not an acknowledgement bound for me. See if it is a message # bound for me by trying to decrypt it with my private keys. @@ -1094,11 +1091,11 @@ class receiveDataThread(threading.Thread): encryptedData[readPosition:]) toRipe = key # This is the RIPE hash of my pubkeys. We need this below to compare to the destination_ripe included in the encrypted data. initialDecryptionSuccessful = True - print 'EC decryption successful using key associated with ripe hash:', key.encode('hex') + logger.info('EC decryption successful using key associated with ripe hash: %s' % str(key.encode('hex'))) break except Exception as err: pass - # print 'cryptorObject.decrypt Exception:', err + logger.debug('cryptorObject.decrypt Exception: %s' % str(err)) if not initialDecryptionSuccessful: # This is not a message bound for me. logger.info('Length of time program spent failing to decrypt this message %s seconds' % diff --git a/src/debug.py b/src/debug.py index a5bb83a9..cc85b70d 100644 --- a/src/debug.py +++ b/src/debug.py @@ -3,7 +3,8 @@ import logging import logging.config -log_level = 'DEBUG' # Get from a config file at some point? +# TODO(xj9): Get from a config file at some point? +log_level = 'DEBUG' logging.config.dictConfig({ 'version': 1,