changeset 43:f14889d6b067

Proper debug logging.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 21 Aug 2014 22:52:05 -0700
parents 9e058e221108
children a62452ab5080
files piecrust/commands/builtin/baking.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/commands/builtin/baking.py	Thu Aug 21 22:51:52 2014 -0700
+++ b/piecrust/commands/builtin/baking.py	Thu Aug 21 22:52:05 2014 -0700
@@ -45,7 +45,10 @@
             baker.bake()
             return 0
         except Exception as ex:
-            logger.error(str(ex))
+            if ctx.app.debug:
+                logger.exception(ex)
+            else:
+                logger.error(str(ex))
             return 1