-def log_exc(msg="",name=None):
- """Log the traceback resulting from an exception."""
+date_width = 24
+def log_exc(msg="", name=None):
+ """Log traceback resulting from an exception."""
+ printout = ""
+ if name:
+ printout += "%s: "%name
+ printout += "EXCEPTION caught <%s> \n" % msg
+ for frame in traceback.format_exc().split("\n"):
+ printout += (date_width+2)*" " + "%s\n" % frame
+ log(printout)
+
+def log_trace(msg="", name=None):
+ """Log current stack"""
+ printout = ""