utils.py

changeset 40
cfbeeec8cb82
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utils.py	Sun Jan 21 21:32:48 2018 +0000
@@ -0,0 +1,10 @@
+#
+# Utility functions for Borgend
+#
+
+def log_exception(logger, err, detail=None):
+    err_type=err.__class__.__name__
+    if detail:
+        logger.critical('%s:%s "%s"', str(detail), err_type, str(err))
+    else:
+        logger.critical('%s "%s"', err_type, str(err))

mercurial