Bläddra i källkod

better logging

Darren Ranalli 19 år sedan
förälder
incheckning
8750d233f8
1 ändrade filer med 7 tillägg och 5 borttagningar
  1. 7 5
      direct/src/distributed/DoHierarchy.py

+ 7 - 5
direct/src/distributed/DoHierarchy.py

@@ -59,23 +59,23 @@ class DoHierarchy:
         return r
         return r
 
 
     def storeObjectLocation(self, do, parentId, zoneId):
     def storeObjectLocation(self, do, parentId, zoneId):
-        assert self.notify.debugCall()
         doId = do.doId
         doId = do.doId
         if doId in self._allDoIds:
         if doId in self._allDoIds:
             self.notify.error(
             self.notify.error(
-                'storeObjectLocation(%s %s) already in _allDoIds' % (
+                'storeObjectLocation(%s %s) already in _allDoIds; duplicate generate()?' % (
                 do.__class__.__name__, do.doId))
                 do.__class__.__name__, do.doId))
         parentZoneDict = self._table.setdefault(parentId, {})
         parentZoneDict = self._table.setdefault(parentId, {})
         zoneDoSet = parentZoneDict.setdefault(zoneId, set())
         zoneDoSet = parentZoneDict.setdefault(zoneId, set())
         zoneDoSet.add(doId)
         zoneDoSet.add(doId)
         self._allDoIds.add(doId)
         self._allDoIds.add(doId)
+        self.notify.debug('storeObjectLocation: %s(%s) @ (%s, %s)' % (
+            do.__class__.__name__, doId, parentId, zoneId))
 
 
     def deleteObjectLocation(self, do, parentId, zoneId):
     def deleteObjectLocation(self, do, parentId, zoneId):
-        assert self.notify.debugCall()
         doId = do.doId
         doId = do.doId
         if doId not in self._allDoIds:
         if doId not in self._allDoIds:
-            self.notify.warning(
-                'deleteObjectLocation(%s %s) not in _allDoIds' % (
+            self.notify.error(
+                'deleteObjectLocation(%s %s) not in _allDoIds; duplicate delete()?' % (
                 do.__class__.__name__, do.doId))
                 do.__class__.__name__, do.doId))
         # jbutler: temp hack to get by the assert, this will be fixed soon
         # jbutler: temp hack to get by the assert, this will be fixed soon
         if (doId not in self._allDoIds):
         if (doId not in self._allDoIds):
@@ -87,6 +87,8 @@ class DoHierarchy:
                 if doId in zoneDoSet:
                 if doId in zoneDoSet:
                     zoneDoSet.remove(doId)
                     zoneDoSet.remove(doId)
                     self._allDoIds.remove(doId)
                     self._allDoIds.remove(doId)
+                    self.notify.debug('deleteObjectLocation: %s(%s) @ (%s, %s)' % (
+                        do.__class__.__name__, doId, parentId, zoneId))
                     if len(zoneDoSet) == 0:
                     if len(zoneDoSet) == 0:
                         del parentZoneDict[zoneId]
                         del parentZoneDict[zoneId]
                         if len(parentZoneDict) == 0:
                         if len(parentZoneDict) == 0: