From d96d51e28d9d081022200f616fbdb286f0d1e1a4 Mon Sep 17 00:00:00 2001 From: Hendrik Buschmeier <hbuschme@uni-bielefeld.de> Date: Fri, 29 Jan 2016 13:03:20 +0100 Subject: [PATCH] Catch exceptions occuring during ipaaca-log-message sending. --- ipaacalib/python/src/ipaaca/util/logger.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ipaacalib/python/src/ipaaca/util/logger.py b/ipaacalib/python/src/ipaaca/util/logger.py index e611b7f..bd254ba 100644 --- a/ipaacalib/python/src/ipaaca/util/logger.py +++ b/ipaacalib/python/src/ipaaca/util/logger.py @@ -46,6 +46,7 @@ import ipaaca __all__ = [ 'logger_send_ipaaca_logs', + 'logger_set_log_filename', 'logger_set_module_name', 'LOG_DEBUG', 'LOG_INFO', @@ -113,7 +114,12 @@ def LOG_IPAACA(lvl, text, now=0.0, fn='???', thread='???'): 'thread': thread, 'uuid': uid, 'text': text,} - OUTPUT_BUFFER.add(msg) + try: + OUTPUT_BUFFER.add(msg) + except Exception, e: + LOG_ERROR('Caught an exception while logging via ipaaca. ' + + ' str(e); ' + + traceback.format_exc()) def LOG_CONSOLE(lvlstr, msg, fn_markup='[38;5;142m', msg_markup='', now=0.0, fn='???', thread='???'): -- GitLab