From 0f5f7725db2b2727b761e9a6036a982103dd093c Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 5 Dec 2023 22:02:34 -0800 Subject: [PATCH] Don't output empty line after each error message. --- samples/ivr_plugins/Callback.py | 2 +- samples/sample-ivrd.py | 2 +- vapp/Agi.py | 2 +- vapp/AsteriskManager.py | 4 ++-- vapp/PluginHandler.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/ivr_plugins/Callback.py b/samples/ivr_plugins/Callback.py index 9ac9031..a2f16fb 100644 --- a/samples/ivr_plugins/Callback.py +++ b/samples/ivr_plugins/Callback.py @@ -72,7 +72,7 @@ def run(self): callbacks_lock.release() except: for msg in traceback.format_exception(*sys.exc_info()): - vapp.logger.error(msg) + vapp.logger.error(msg.rstrip()) time.sleep(5) class Plugin(vapp.BasePlugin): diff --git a/samples/sample-ivrd.py b/samples/sample-ivrd.py index 195fa5e..d60defc 100755 --- a/samples/sample-ivrd.py +++ b/samples/sample-ivrd.py @@ -73,6 +73,6 @@ def daemonize(): pass except: for msg in traceback.format_exception(*sys.exc_info()): - logger.error(msg) + logger.error(msg.rstrip()) logger.error("Unrecoverable error. Exiting...") sys.exit(1) diff --git a/vapp/Agi.py b/vapp/Agi.py index 5a4f1a5..8dafb90 100644 --- a/vapp/Agi.py +++ b/vapp/Agi.py @@ -206,7 +206,7 @@ def handle(self): except: if (vapp.logger != None): for msg in traceback.format_exception(*sys.exc_info()): - vapp.logger.error(msg) + vapp.logger.error(msg.rstrip()) def runSession(self): raise NotImplementedError() diff --git a/vapp/AsteriskManager.py b/vapp/AsteriskManager.py index 064954f..bdcd995 100644 --- a/vapp/AsteriskManager.py +++ b/vapp/AsteriskManager.py @@ -279,7 +279,7 @@ def run(self): self.__sock = None # force reconnect if (self.__logger): for msg in traceback.format_exception(*sys.exc_info()): - self.__logger.error(msg) + self.__logger.error(msg.rstrip()) try: tmp.close() @@ -484,7 +484,7 @@ def registerChannel(self, listener): except: if (self.__logger): for msg in traceback.format_exception(*sys.exc_info()): - self.__logger.error(msg) + self.__logger.error(msg.rstrip()) self.__chan_lock.release() def unregisterChannel(self, listener): diff --git a/vapp/PluginHandler.py b/vapp/PluginHandler.py index cbf8b34..28c71ee 100644 --- a/vapp/PluginHandler.py +++ b/vapp/PluginHandler.py @@ -64,7 +64,7 @@ def loadPlugins(plugin_packages, exclude_modules = []): mod = __import__(full_name, fromlist = ['']) except: for msg in traceback.format_exception(*sys.exc_info()): - _logger.error(msg) + _logger.error(msg.rstrip()) sys.exit(1) try: @@ -174,7 +174,7 @@ def handleCall(self): self.error("BAD PROMPT. Trace dumped into %s" % e.dumpFileName()) except: for msg in traceback.format_exception(*sys.exc_info()): - self.error(msg) + self.error(msg.rstrip()) def cleanup(self): """