From 623535b6b1efdcf114712dc52db39a32eb992b43 Mon Sep 17 00:00:00 2001 From: Sean Shahkarami Date: Mon, 11 Jul 2022 14:49:39 -0500 Subject: [PATCH] log exception when debugging level logging is enabled --- src/waggle/plugin/rabbitmq.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/waggle/plugin/rabbitmq.py b/src/waggle/plugin/rabbitmq.py index 91c0b6f..f6be12b 100644 --- a/src/waggle/plugin/rabbitmq.py +++ b/src/waggle/plugin/rabbitmq.py @@ -35,6 +35,8 @@ def __main(self): try: self.__connect_and_flush_messages() except Exception: + if logger.isEnabledFor(logging.DEBUG): + logger.exception("__connect_and_flush_messages exception") time.sleep(1) finally: self.done.set() @@ -108,6 +110,8 @@ def __main(self): try: self.__connect_and_consume_messages() except Exception: + if logger.isEnabledFor(logging.DEBUG): + logger.exception("__connect_and_consume_messages exception") time.sleep(1) finally: self.done.set()