[Zope-Checkins] CVS: Zope3/lib/python/Transaction - _defaultTransaction.py:1.4

Jeremy Hylton jeremy@zope.com
Fri, 21 Jun 2002 16:39:05 -0400


Update of /cvs-repository/Zope3/lib/python/Transaction
In directory cvs.zope.org:/tmp/cvs-serv1290

Modified Files:
	_defaultTransaction.py 
Log Message:
Add logging to transaction commit().

If an object has no _p_jar, log at PROBLEM level.
Otherwise, log at debug level.


=== Zope3/lib/python/Transaction/_defaultTransaction.py 1.3 => 1.4 ===
 
 from Transaction.Exceptions import ConflictError, TransactionError
-from zLOG import LOG, ERROR, PANIC
+from zLOG import LOG, ERROR, PANIC, PROBLEM, DEBUG
 
 # Flag indicating whether certain errors have occurred.
 hosed = 0
@@ -229,7 +229,13 @@
         try:
             for o in objects:
                 j = getattr(o, '_p_jar', o)
-                if j is not None:
+                if j is None:
+                    LOG("Transaction", PROBLEM,
+                        "Ignoring object %s because it has no jar" % repr(o))
+                else:
+                    if __debug__:
+                        LOG("Transaction", DEBUG,
+                            "Committing %s with jar %s" % (repr(o), j))
                     i = id(j)
                     if i not in jars:
                         jars[i] = j