[Zope3-checkins] CVS: Zope/lib/python/ZConfig/components/logger - logger.py:1.2

Fred L. Drake, Jr. fred at zope.com
Fri Apr 9 17:22:30 EDT 2004


Update of /cvs-repository/Zope/lib/python/ZConfig/components/logger
In directory cvs.zope.org:/tmp/cvs-serv28631/ZConfig/components/logger

Modified Files:
	logger.py 
Log Message:
Change the mapping from zLOG to the logging package:
- don't dump everything into the "event" logger;
  use the subsystem argument to zLOG.LOG to get a specific logger
- move some comments into docstrings


=== Zope/lib/python/ZConfig/components/logger/logger.py 1.1 => 1.2 ===
--- Zope/lib/python/ZConfig/components/logger/logger.py:1.1	Fri Jan  2 13:46:12 2004
+++ Zope/lib/python/ZConfig/components/logger/logger.py	Fri Apr  9 17:21:58 2004
@@ -17,6 +17,15 @@
 
 
 class LoggerFactoryBase(Factory):
+    """Base class for logger factories.
+
+    Factory used to create loggers while delaying actual logger
+    instance construction.  We need to do this because we may want to
+    reference a logger before actually instantiating it (for example,
+    to allow the app time to set an effective user).  An instance of
+    this wrapper is a callable which, when called, returns a logger
+    object.
+    """
 
     def __init__(self, section):
         Factory.__init__(self)
@@ -44,24 +53,13 @@
 
 
 class EventLogFactory(LoggerFactoryBase):
-    """
-    A wrapper used to create loggers while delaying actual logger
-    instance construction.  We need to do this because we may
-    want to reference a logger before actually instantiating it (for example,
-    to allow the app time to set an effective user).
-    An instance of this wrapper is a callable which, when called, returns a
-    logger object.
-    """
+    """Logger factory that returns the root logger."""
 
-    name = "event"
-
-    def create(self):
-        logger = LoggerFactoryBase.create(self)
-        logger.propagate = 0
-        return logger
+    name = None
 
 
 class LoggerFactory(LoggerFactoryBase):
+    """Logger factory that returns the named logger."""
 
     def __init__(self, section):
         LoggerFactoryBase.__init__(self, section)




More information about the Zope3-Checkins mailing list