[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/ Merge revision 25935 from the trunk.

Fred L. Drake, Jr. fred at zope.com
Tue Jun 22 11:54:58 EDT 2004


Log message for revision 25936:
Merge revision 25935 from the trunk.

- move the accesslog configuration out of ZConfig

(The other change from revision 25935, the removal of the <hitlog> section,
was already made on the ZopeX3-3.0 branch.)



-=-
Modified: Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/component.xml
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/component.xml	2004-06-22 15:15:07 UTC (rev 25935)
+++ Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/component.xml	2004-06-22 15:52:49 UTC (rev 25936)
@@ -6,6 +6,5 @@
   <import package="ZConfig.components.logger" file="handlers.xml"/>
   <import package="ZConfig.components.logger" file="logger.xml"/>
   <import package="ZConfig.components.logger" file="eventlog.xml"/>
-  <import package="ZConfig.components.logger" file="hitlog.xml"/>
 
 </component>

Deleted: Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/hitlog.xml
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/hitlog.xml	2004-06-22 15:15:07 UTC (rev 25935)
+++ Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/hitlog.xml	2004-06-22 15:52:49 UTC (rev 25936)
@@ -1,17 +0,0 @@
-<component prefix="ZConfig.components.logger.logger">
-
-  <import package="ZConfig.components.logger" file="abstract.xml"/>
-  <import package="ZConfig.components.logger" file="base-logger.xml"/>
-
-  <sectiontype name="accesslog"
-               datatype=".AccessLogFactory"
-               extends="ZConfig.logger.base-logger">
-    <description>
-      Configuration for the access logger.
-
-      Note that the setting of verbosity level and message formats are not
-      used.
-    </description>
-  </sectiontype>
-
-</component>

Modified: Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/logger.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/logger.py	2004-06-22 15:15:07 UTC (rev 25935)
+++ Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/logger.py	2004-06-22 15:52:49 UTC (rev 25936)
@@ -87,21 +87,6 @@
     name = None
 
 
-class AccessLogFactory(LoggerFactoryBase):
-    """Logger factory that returns the access logger."""
-
-    name = "accesslog"
-
-    def create(self):
-        logger = LoggerFactoryBase.create(self)
-        logger.setLevel(logging.INFO)
-        logger.propagate = False
-        formatter = logging.Formatter()
-        for handler in logger.handlers:
-            handler.setFormatter(formatter)
-        return logger
-
-
 class LoggerFactory(LoggerFactoryBase):
     """Logger factory that returns the named logger."""
 

Modified: Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/tests/test_logger.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/tests/test_logger.py	2004-06-22 15:15:07 UTC (rev 25935)
+++ Zope3/branches/ZopeX3-3.0/src/ZConfig/components/logger/tests/test_logger.py	2004-06-22 15:52:49 UTC (rev 25936)
@@ -226,59 +226,8 @@
         return logger
 
 
-class TestAccessLogging(LoggingTestBase):
-
-    name = "accesslog"
-
-    _schematext = """
-      <schema>
-        <import package='ZConfig.components.logger'/>
-        <section type='accesslog' name='*' attribute='accesslog'/>
-      </schema>
-    """
-
-    def test_config_without_logger(self):
-        conf = self.get_config("")
-        self.assert_(conf.accesslog is None)
-
-    def test_config_without_handlers(self):
-        logger = self.check_simple_logger("<accesslog/>")
-        # Make sure there's a NullHandler, since a warning gets
-        # printed if there are no handlers:
-        self.assertEqual(len(logger.handlers), 1)
-        self.assert_(isinstance(logger.handlers[0],
-                                loghandler.NullHandler))
-
-    def test_formatter(self):
-        logger = self.check_simple_logger("<accesslog>\n"
-                                          "  <syslog>\n"
-                                          "    level error\n"
-                                          "    facility local3\n"
-                                          "    format xyzzy\n"
-                                          "  </syslog>\n"
-                                          "</accesslog>")
-        self.assertEqual(len(logger.handlers), 1)
-        syslog = logger.handlers[0]
-        self.assertEqual(syslog.level, logging.ERROR)
-        self.assert_(isinstance(syslog, loghandler.SysLogHandler))
-        self.assertEqual(syslog.formatter._fmt, "%(message)s")
-
-    def check_simple_logger(self, text):
-        conf = self.get_config(text)
-        self.assert_(conf.accesslog is not None)
-        logger = conf.accesslog()
-        self.assert_(isinstance(logger, logging.Logger))
-        self.assert_(not logger.propagate)
-        self.assertEquals(logger.name, "accesslog")
-        self.assertEquals(logger.level, logging.INFO)
-        return logger
-
-
 def test_suite():
-    suite = unittest.TestSuite()
-    suite.addTest(unittest.makeSuite(TestConfig))
-    suite.addTest(unittest.makeSuite(TestAccessLogging))
-    return suite
+    return unittest.makeSuite(TestConfig)
 
 if __name__ == '__main__':
     unittest.main(defaultTest="test_suite")

Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/server/accesslog.py (from rev 25935, Zope3/trunk/src/zope/app/server/accesslog.py)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/app/server/accesslog.py
___________________________________________________________________
Name: svn:mime-type
   + text/x-python
Name: svn:eol-style
   + native

Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/server/accesslog.xml (from rev 25935, Zope3/trunk/src/zope/app/server/accesslog.xml)

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/server/schema.xml
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/server/schema.xml	2004-06-22 15:15:07 UTC (rev 25935)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/server/schema.xml	2004-06-22 15:52:49 UTC (rev 25936)
@@ -11,6 +11,7 @@
 
   <!-- logging configuration -->
   <import package="ZConfig.components.logger" />
+  <import package="zope.app.server" file="accesslog.xml" />
 
   <sectiontype name="server" datatype="zope.app.server.server.ServerFactory">
     <key name="type" required="yes" />

Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/server/tests/test_accesslog.py (from rev 25935, Zope3/trunk/src/zope/app/server/tests/test_accesslog.py)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/app/server/tests/test_accesslog.py
___________________________________________________________________
Name: svn:mime-type
   + text/x-python
Name: svn:eol-style
   + native




More information about the Zope3-Checkins mailing list