From 24398fa55bb92953d5dd85a2285be992411b2d85 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Mon, 23 Jun 2014 13:49:05 +0100 Subject: [PATCH 02/13] [sosreport] log exceptions during Plugin.postproc() --- sos/sosreport.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sos/sosreport.py b/sos/sosreport.py index f27df40..cd9aff3 100755 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -871,6 +871,12 @@ No changes will be made to system configuration. except: if GlobalVars.__raisePlugins__: raise + else: + error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + etype, eval, etrace = sys.exc_info() + traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) + error_log.write(traceback.format_exc()) + error_log.close() if GlobalVars.__cmdLineOpts__.build: print -- 1.9.3