summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagappan Alagappan <nagappan@gmail.com>2013-09-28 21:56:38 -0700
committerNagappan Alagappan <nagappan@gmail.com>2013-09-28 21:56:38 -0700
commit85d35ba4f521b3ddf3fcb90c437c8dfc5894d108 (patch)
treef20d73b8c6d33f6b08a146f503787d146509d94c
parente513654c69c341040256033f12d86f1b97d22a1b (diff)
Update traceback to log file, if LDTP_DEBUG_FILE environment variable is set
-rw-r--r--ldtpd/core.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ldtpd/core.py b/ldtpd/core.py
index 19c34a3..10a3834 100644
--- a/ldtpd/core.py
+++ b/ldtpd/core.py
@@ -107,6 +107,9 @@ class Ldtpd(Utils, ComboBox, Table, Menu, PageTabList,
except:
if self._ldtp_debug:
print(traceback.format_exc())
+ if self._ldtp_debug_file:
+ with open(self._ldtp_debug_file, "a") as fp:
+ fp.write(traceback.format_exc())
def _registered_kb_event_cb(self, event):
if not event:
@@ -145,6 +148,9 @@ class Ldtpd(Utils, ComboBox, Table, Menu, PageTabList,
except:
if self._ldtp_debug:
print(traceback.format_exc())
+ if self._ldtp_debug_file:
+ with open(self._ldtp_debug_file, "a") as fp:
+ fp.write(traceback.format_exc())
def appundertest(self, app_name):
"""
@@ -819,6 +825,9 @@ class Ldtpd(Utils, ComboBox, Table, Menu, PageTabList,
ObjectExistsWaiter(window_name, object_name, guiTimeOut, state)
return int(waiter.run())
except:
+ if self._ldtp_debug_file:
+ with open(self._ldtp_debug_file, "a") as fp:
+ fp.write(traceback.format_exc())
if self._ldtp_debug:
print(traceback.format_exc())
return 0