From c6d69b231b9cd193ed84022696e3ffe4e9baceb6 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sun, 14 Feb 2016 18:55:27 +0100 Subject: [PATCH] when verbose logging is enabled, print a traceback of possibly raised exceptions --- src/img2pdf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/img2pdf.py b/src/img2pdf.py index 47dedcf..9329d98 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -1581,6 +1581,9 @@ values set via the --border option. args.without_pdfrw, outputstream=args.output) except Exception as e: logging.error("error: " + str(e)) + if logging.getLogger().isEnabledFor(logging.DEBUG): + import traceback + traceback.print_exc(file=sys.stderr) exit(1) if __name__ == '__main__':