more logging on startup

This commit is contained in:
Job Evers-Meltzer 2016-11-11 10:10:00 -06:00
parent 0abc081edc
commit 3b34bddf0a
2 changed files with 5 additions and 1 deletions

View file

@ -78,8 +78,10 @@ def obfuscate(plain):
def check_connection(server="www.lbry.io", port=80):
"""Attempts to open a socket to server:port and returns True if successful."""
try:
log.debug('Checking connection to %s:%s', server, port)
host = socket.gethostbyname(server)
s = socket.create_connection((host, port), 2)
log.debug('Connection successful')
return True
except Exception as ex:
log.info(

View file

@ -78,12 +78,14 @@ def start():
log.debug('Final Settings: %s', settings.__dict__)
try:
log.debug('Checking for an existing lbrynet daemon instance')
JSONRPCProxy.from_url(settings.API_CONNECTION_STRING).is_running()
log.info("lbrynet-daemon is already running")
if not args.logtoconsole:
print "lbrynet-daemon is already running"
return
except:
except Exception:
log.debug('No lbrynet instance found, continuing to start')
pass
log.info("Starting lbrynet-daemon from command line")