From 65db908fb6213d2c785773b26ad69f1dd1534979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Wed, 1 Apr 2020 02:05:15 +0200 Subject: [PATCH] add more logging --- communicator.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/communicator.py b/communicator.py index be1fc67..f27940a 100644 --- a/communicator.py +++ b/communicator.py @@ -35,8 +35,9 @@ class Communicator: :return: none """ currentconsumer=self.currenctconsumer - LOGGER.debug(f"Sending message to {currentconsumer}") - requests.post(f'http://{currentconsumer}/log', json={'uuid': self.uuid, 'message': message}) + LOGGER.info(f"Sending message to {currentconsumer}") + postresponse=requests.post(f'http://{currentconsumer}/log', json={'uuid': self.uuid, 'message': message}) + LOGGER.debug(f"Message status code is:{postresponse.status_code}") def discoveravailableconsumers(self) -> list: """ @@ -47,7 +48,7 @@ class Communicator: currentconsumer = self.currenctconsumer response = requests.get(f'http://{currentconsumer}/consumer') json = response.json() - LOGGER.debug(f"List of currently available consumers: {json}") + LOGGER.info(f"List of currently available consumers: {json}") return json except Exception: return [] @@ -64,7 +65,7 @@ class Communicator: except Exception as e: LOGGER.exception(e) isavailable = False - LOGGER.debug(f"Current consumer availability: {isavailable}") + LOGGER.info(f"Current consumer availability: {isavailable}") return isavailable def checkconsumer(self, consumer: str) -> bool: @@ -79,7 +80,7 @@ class Communicator: except Exception as e: LOGGER.exception(e) isavailable = False - LOGGER.debug(f"Consumer {consumer} availability: {isavailable}") + LOGGER.info(f"Consumer {consumer} availability: {isavailable}") return isavailable def set_currentconsumer(self,currenctconsumer):