diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-10-05 15:42:42 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-10-05 15:42:42 +0000 |
commit | 38df0d1a59d2c1fe80c563b39706047bd7ba94b5 (patch) | |
tree | 564f10c6f32768ffdc159692cecc804b11e096df /rdiff-backup/rdiff_backup/log.py | |
parent | 1c08d51312515c0adbba4904498b60d632b8b70f (diff) | |
download | rdiff-backup-38df0d1a59d2c1fe80c563b39706047bd7ba94b5.tar.gz |
Added better logging for check_common_error - now it should be clearer
which file was being processed when error occurred.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@218 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/log.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/log.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/log.py b/rdiff-backup/rdiff_backup/log.py index 1e5998e..4e7cbe3 100644 --- a/rdiff-backup/rdiff_backup/log.py +++ b/rdiff-backup/rdiff_backup/log.py @@ -145,11 +145,14 @@ class Logger: Main.cleanup() sys.exit(1) - def exception_to_string(self): - """Return string version of current exception""" + def exception_to_string(self, arglist = []): + """Return string version of current exception plus what's in arglist""" type, value, tb = sys.exc_info() - return ("Exception '%s' raised of class '%s':\n%s" % - (value, type, "".join(traceback.format_tb(tb)))) + s = ("Exception '%s' raised of class '%s':\n%s" % + (value, type, "".join(traceback.format_tb(tb)))) + if arglist: + s += "__Arguments:\n" + "\n".join(map(str, arglist)) + return s def exception(self, only_terminal = 0, verbosity = 5): """Log an exception and traceback |