From cecde860057927ca85eb2ef5ef8a6f4c1c07c556 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Fri, 21 Sep 2018 15:27:02 +0200 Subject: [PATCH] insert logging --- boswatch/network/netCheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boswatch/network/netCheck.py b/boswatch/network/netCheck.py index 8b69703..2c2e991 100644 --- a/boswatch/network/netCheck.py +++ b/boswatch/network/netCheck.py @@ -27,7 +27,7 @@ class NetCheck: """!Create a new NetCheck instance @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._timeout = timeout @@ -37,6 +37,8 @@ class NetCheck: @return True or False""" try: urlopen(self._hostname, timeout=self._timeout) + logging.debug("%s is reachable", self._hostname) return True except: + logging.warning("%s is not reachable", self._hostname) return False