changeset 1853:3ddf2193a16e

reduced cache logging
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 02 Mar 2007 22:45:12 +0100
parents b978764e1234
children 2d54d55bc351
files MoinMoin/Page.py MoinMoin/logfile/editlog.py
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Thu Mar 01 09:27:16 2007 +0100
+++ b/MoinMoin/Page.py	Fri Mar 02 22:45:12 2007 +0100
@@ -38,6 +38,7 @@
                             # to avoid reading in the whole log on first request
         self.requests = 0
         self.hits = 0
+        self.loglevel = logging.NOTSET
 
     def putItem(self, request, name, key, data):
         """ Remembers some data for item name under a key.
@@ -65,7 +66,7 @@
             data = None
             hit_str = 'miss'
         self.requests += 1
-        logging.debug("%s cache %s (h/r %2.1f%%) for %r %r" % (
+        logging.log(self.loglevel, "%s cache %s (h/r %2.1f%%) for %r %r" % (
             self.name,
             hit_str,
             float(self.hits * 100) / self.requests,
@@ -87,13 +88,13 @@
         if items:
             if self.name == 'meta':
                 for item in items:
-                    logging.debug("cache: removing %r" % item)
+                    logging.log(self.loglevel, "cache: removing %r" % item)
                     try:
                         del self.cache[item]
                     except:
                         pass
             elif self.name == 'pagelists':
-                logging.debug("cache: clearing pagelist cache")
+                logging.log(self.loglevel, "cache: clearing pagelist cache")
                 self.cache = {}
         self.log_pos = new_pos # important to do this at the end -
                                # avoids threading race conditions
@@ -1524,7 +1525,7 @@
                 aclRevision, acl = None, None
             else:
                 aclRevision, acl = cache_data
-            logging.debug("currrev: %r, cachedaclrev: %r" % (currentRevision, aclRevision))
+            #logging.debug("currrev: %r, cachedaclrev: %r" % (currentRevision, aclRevision))
             if aclRevision != currentRevision:
                 acl = self.parseACL()
                 cache_data = (currentRevision, acl)
--- a/MoinMoin/logfile/editlog.py	Thu Mar 01 09:27:16 2007 +0100
+++ b/MoinMoin/logfile/editlog.py	Fri Mar 02 22:45:12 2007 +0100
@@ -222,6 +222,6 @@
             items.append(line.pagename)
 
         newposition = self.position()
-        logging.debug("editlog.news: new pos: %r new items: %r", newposition, items)
+        logging.log(logging.NOTSET, "editlog.news: new pos: %r new items: %r", newposition, items)
         return newposition, items