forked from LBRYCommunity/lbry-sdk
logging
This commit is contained in:
parent
f7aa478b9b
commit
cfd4a94450
1 changed files with 6 additions and 8 deletions
|
@ -103,8 +103,8 @@ def check_connection(server="lbry.io", port=80, timeout=2):
|
||||||
log.debug('Connection successful')
|
log.debug('Connection successful')
|
||||||
return True
|
return True
|
||||||
except (socket.gaierror, socket.herror) as ex:
|
except (socket.gaierror, socket.herror) as ex:
|
||||||
log.info("Failed to connect to %s:%s. Unable to resolve domain. Trying to bypass DNS",
|
log.warning("Failed to connect to %s:%s. Unable to resolve domain. Trying to bypass DNS",
|
||||||
server, port, exc_info=True)
|
server, port)
|
||||||
try:
|
try:
|
||||||
server = "8.8.8.8"
|
server = "8.8.8.8"
|
||||||
port = 53
|
port = 53
|
||||||
|
@ -112,14 +112,12 @@ def check_connection(server="lbry.io", port=80, timeout=2):
|
||||||
log.debug('Connection successful')
|
log.debug('Connection successful')
|
||||||
return True
|
return True
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
log.info(
|
log.error("Failed to connect to %s:%s. Maybe the internet connection is not working",
|
||||||
"Failed to connect to %s:%s. Maybe the internet connection is not working",
|
server, port)
|
||||||
server, port, exc_info=True)
|
|
||||||
return False
|
return False
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
log.info(
|
log.error("Failed to connect to %s:%s. Maybe the internet connection is not working",
|
||||||
"Failed to connect to %s:%s. Maybe the internet connection is not working",
|
server, port)
|
||||||
server, port, exc_info=True)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue