mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-03-02 19:13:55 +01:00
insert logging
This commit is contained in:
parent
3cf0b49c0e
commit
cecde86005
|
|
@ -27,7 +27,7 @@ class NetCheck:
|
||||||
"""!Create a new NetCheck instance
|
"""!Create a new NetCheck instance
|
||||||
|
|
||||||
@param hostname: host against connection check is running ("https://www.google.com/")
|
@param hostname: host against connection check is running ("https://www.google.com/")
|
||||||
@param timout: timout for connection check in sec."""
|
@param timout: timout for connection check in sec. (1)"""
|
||||||
self._hostname = hostname
|
self._hostname = hostname
|
||||||
self._timeout = timeout
|
self._timeout = timeout
|
||||||
|
|
||||||
|
|
@ -37,6 +37,8 @@ class NetCheck:
|
||||||
@return True or False"""
|
@return True or False"""
|
||||||
try:
|
try:
|
||||||
urlopen(self._hostname, timeout=self._timeout)
|
urlopen(self._hostname, timeout=self._timeout)
|
||||||
|
logging.debug("%s is reachable", self._hostname)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
|
logging.warning("%s is not reachable", self._hostname)
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue