From d328dd2ca47a03f7b305f01b70b1a180265f6903 Mon Sep 17 00:00:00 2001
From: Rob Kinninmont <robk@allmydata.com>
Date: Thu, 30 Nov 2006 15:24:08 -0700
Subject: [PATCH] update assertutil to use twisted log instead of amdlib Log

---
 amdlib/util/assertutil.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/amdlib/util/assertutil.py b/amdlib/util/assertutil.py
index 368407d1..2adae8d6 100644
--- a/amdlib/util/assertutil.py
+++ b/amdlib/util/assertutil.py
@@ -11,7 +11,7 @@ Tests useful in assertion checking, prints out nicely formated messages too.
 
 from humanreadable import hr
 
-import Log
+from twisted.python import log
 
 def _assert(___cond=False, *___args, **___kwargs):
     if ___cond:
@@ -48,10 +48,12 @@ def precondition(___cond=False, *___args, **___kwargs):
                 msgbuf.append("%s: %s %s" % ((___kwargs.items()[0][0],) + tuple(map(hr, (___kwargs.items()[0][1], type(___kwargs.items()[0][1]),)))))
         msgbuf.extend([", %s: %s %s" % tuple(map(hr, (k, v, type(v),))) for k, v in ___kwargs.items()[1:]])
     except Exception, le:
-        Log.Log(Log.ERR, 'assertutil', "INTERNAL ERROR IN pyutil.assertutil. %s %s %s" % (type(le), repr(le), le.args,))
+        log.msg("assertutil.precondition(): INTERNAL ERROR IN pyutil.assertutil. %s %s %s" % (type(le), repr(le), le.args,))
+        log.err()
         raise le
     except:
-        Log.Log(Log.ERR, 'assertutil', "INTERNAL ERROR IN pyutil.assertutil.")
+        log.msg("assertutil.precondition(): INTERNAL ERROR IN pyutil.assertutil.")
+        log.err()
         raise
 
     raise AssertionError, "".join(msgbuf)
-- 
2.45.2