changeset 5:dba51b33fd9e

Log backtrace on unexpected exception.
author darius
date Mon, 24 Sep 2007 13:34:47 +0000
parents 618372f83862
children a51f78d44552
files beermon.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/beermon.py	Mon Sep 24 13:31:15 2007 +0000
+++ b/beermon.py	Mon Sep 24 13:34:47 2007 +0000
@@ -4,7 +4,7 @@
 # Monitor & control fermenter temperature 
 # v1.0
 #
-# $Id: beermon.py,v 1.3 2007/09/24 13:31:15 darius Exp $
+# $Id: beermon.py,v 1.4 2007/09/24 13:34:47 darius Exp $
 #
 # Depends on: Python 2.3 (I think)
 #
@@ -309,7 +309,7 @@
     log = initLog()
 
     log.debug("=== Initing ===")
-    log.debug("$Id: beermon.py,v 1.3 2007/09/24 13:31:15 darius Exp $")
+    log.debug("$Id: beermon.py,v 1.4 2007/09/24 13:34:47 darius Exp $")
 
     m = None
     exitCode = 0
@@ -327,10 +327,10 @@
         log.debug("Exiting due to keyboard interrupt")
 
     except Exception, e:
-        log.debug("Something went wrong, details below")
+        log.debug("Something went wrong, details below:")
         log.debug(e)
-        #log.debug(reduce(lambda x, y: x + y, traceback.format_exception(
-        #    sys.last_type, sys.last_value, sys.last_traceback)))
+        log.debug(reduce(lambda x, y: x + y, traceback.format_exception(
+            sys.exc_type, sys.exc_value, sys.exc_traceback)))
         exitCode = 1
         
     finally: