Merge pull request #266 from lbryio/startup-logging

more logging on startup
This commit is contained in:
Job Evers‐Meltzer 2016-11-11 11:11:02 -06:00 committed by GitHub
commit 0736fa506b
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): def check_connection(server="www.lbry.io", port=80):
"""Attempts to open a socket to server:port and returns True if successful.""" """Attempts to open a socket to server:port and returns True if successful."""
try: try:
log.debug('Checking connection to %s:%s', server, port)
host = socket.gethostbyname(server) host = socket.gethostbyname(server)
s = socket.create_connection((host, port), 2) s = socket.create_connection((host, port), 2)
log.debug('Connection successful')
return True return True
except Exception as ex: except Exception as ex:
log.info( log.info(

View file

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