[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex - FilteredSet.py:1.8 TopicIndex.py:1.18

Andreas Jung andreas at andreas-jung.com
Tue Apr 20 10:31:16 EDT 2004


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex
In directory cvs.zope.org:/tmp/cvs-serv9130/lib/python/Products/PluginIndexes/TopicIndex

Modified Files:
	FilteredSet.py TopicIndex.py 
Log Message:
zLOG -> logging


=== Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py 1.7 => 1.8 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py:1.7	Thu Jan 15 18:17:17 2004
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py	Tue Apr 20 10:30:45 2004
@@ -13,14 +13,17 @@
 
 __version__ = '$Id$'
 
+import sys
+from logging import getLogger
+
 from ZODB.POSException import ConflictError
 from BTrees.IIBTree import IITreeSet
 from Persistence import Persistent
 from Globals import DTMLFile
-from zLOG import WARNING,LOG
+
 from RestrictedPython.Eval import RestrictionCapableEval
-import sys
 
+LOG = getLogger('Zope.TopicIndex.FilteredSet')
 
 class FilteredSetBase(Persistent):
 
@@ -29,20 +32,16 @@
         self.expr = expr
         self.clear()
 
-
     def clear(self):
         self.ids  = IITreeSet()
 
-
     def index_object(self, documentId, obj):
         raise RuntimeError,'index_object not defined'
 
-
     def unindex_object(self,documentId):
         try: self.ids.remove(documentId)
         except KeyError: pass
 
-
     def getId(self):
         return self.id
         
@@ -63,7 +62,6 @@
     __str__ = __repr__
 
 
-
 class PythonFilteredSet(FilteredSetBase):
 
     meta_type = 'PythonFilteredSet'
@@ -80,10 +78,8 @@
         except ConflictError:
             raise
         except:
-            LOG('FilteredSet',WARNING,'eval() failed',\
-                'Object: %s, expr: %s' % (o.getId(),self.expr),\
-                sys.exc_info())
-
+            LOG.warn('eval() failed Object: %s, expr: %s' %\
+                     (o.getId(),self.expr), exc_info=sys.exc_info())
 
 
 def factory(f_id, f_type, expr):


=== Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py 1.17 => 1.18 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py:1.17	Wed Dec 31 17:32:21 2003
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py	Tue Apr 20 10:30:45 2004
@@ -13,9 +13,10 @@
 
 __version__ = '$Id$'
 
+from logging import getLogger
+
 from Globals import Persistent, DTMLFile
 from OFS.SimpleItem import SimpleItem
-from zLOG import ERROR, LOG
 from BTrees.OOBTree import OOBTree
 from BTrees.IIBTree import IITreeSet,intersection,union
 
@@ -24,6 +25,7 @@
 from Products.PluginIndexes.common.util import parseIndexRequest
 
 _marker = []
+LOG = getLogger('Zope.TopicIndex')
 
 class TopicIndex(Persistent, SimpleItem):
 
@@ -69,9 +71,8 @@
             try:
                 fs.unindex_object(docid)
             except KeyError:
-                LOG(self.__class__.__name__, ERROR,
-                    'Attempt to unindex document'
-                    ' with id %s failed' % docid)
+                LOG.error('Attempt to unindex document'
+                          ' with id %s failed' % docid)
         return 1
 
     def numObjects(self):




More information about the Zope-Checkins mailing list