[debug] when a loop is detected in a tree, log the entity involved in it to ease repair stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 26 Jul 2010 12:07:00 +0200
branchstable
changeset 6011 b5f15098f282
parent 6010 9d40ee3d0551
child 6012 d56fd78006cd
child 6014 a5e22657f6f4
[debug] when a loop is detected in a tree, log the entity involved in it to ease repair
entities/adapters.py
mixins.py
--- a/entities/adapters.py	Mon Jul 26 12:06:58 2010 +0200
+++ b/entities/adapters.py	Mon Jul 26 12:07:00 2010 +0200
@@ -294,7 +294,7 @@
             _done = set()
         for child in self.children():
             if child.eid in _done:
-                self.error('loop in %s tree', child.__regid__.lower())
+                self.error('loop in %s tree: %s', child.__regid__.lower(), child)
                 continue
             yield child
             _done.add(child.eid)
@@ -320,7 +320,7 @@
         entity = adapter.entity
         while entity is not None:
             if entity.eid in path:
-                self.error('loop in %s tree', entity.__regid__.lower())
+                self.error('loop in %s tree: %s', entity.__regid__.lower(), entity)
                 break
             path.append(entity.eid)
             try:
--- a/mixins.py	Mon Jul 26 12:06:58 2010 +0200
+++ b/mixins.py	Mon Jul 26 12:07:00 2010 +0200
@@ -71,7 +71,7 @@
             _done = set()
         for child in self.children():
             if child.eid in _done:
-                self.error('loop in %s tree', self.__regid__.lower())
+                self.error('loop in %s tree: %s', self.__regid__.lower(), child)
                 continue
             yield child
             _done.add(child.eid)
@@ -94,7 +94,7 @@
         parent = self
         while parent:
             if parent.eid in path:
-                self.error('loop in %s tree', self.__regid__.lower())
+                self.error('loop in %s tree: %s', self.__regid__.lower(), parent)
                 break
             path.append(parent.eid)
             try: