[Mpuls-commits] r5181 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 20 10:15:03 CEST 2011


Author: ludwig
Date: 2011-07-20 10:15:01 +0200 (Wed, 20 Jul 2011)
New Revision: 5181

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/logfilter.py
Log:
Issue2009: Improvement to the mechanism which creates a handler with
filter. Now filtered_handler with basehandler and the arguments
must be called as class. So it is possible to config different
handlers.

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-07-20 07:13:04 UTC (rev 5180)
+++ base/trunk/ChangeLog	2011-07-20 08:15:01 UTC (rev 5181)
@@ -1,3 +1,11 @@
+2011-07-20  Ludwig Reiter <ludwig.reiter at intevation.de>
+
+	* mpulsweb/lib/logfilter.py:
+	Issue2009: Improvement to the mechanism which creates a handler with
+	filter. Now filtered_handler with basehandler and the arguments
+	must be called as class. So it is possible to config different
+	handlers.
+
 2011-07-19  Ludwig Reiter <ludwig.reiter at intevation.de>
 
 	* mpulsweb/lib/logfilter.py:

Modified: base/trunk/mpulsweb/lib/logfilter.py
===================================================================
--- base/trunk/mpulsweb/lib/logfilter.py	2011-07-20 07:13:04 UTC (rev 5180)
+++ base/trunk/mpulsweb/lib/logfilter.py	2011-07-20 08:15:01 UTC (rev 5181)
@@ -29,10 +29,15 @@
 
         return True
 
-class DBNameHandler(logging.StreamHandler):
-    """
-    Handler with DBNameContextFilter.
-    """
-    def __init__(self, *args, **kwargs):
-        logging.StreamHandler.__init__(self, *args, **kwargs)
-        self.addFilter(DBNameContextFilter())
+#class DBNameHandler(logging.StreamHandler):
+#    """
+#    Handler with DBNameContextFilter.
+#    """
+#    def __init__(self, *args, **kwargs):
+#        logging.StreamHandler.__init__(self, *args, **kwargs)
+#        self.addFilter(DBNameContextFilter())
+
+def filtered_handler(base_handler, *args):
+    handler = base_handler(*args)
+    handler.addFilter(DBNameContextFilter())
+    return handler



More information about the Mpuls-commits mailing list