[Zodb-checkins] CVS: ZODB3/zLOG - component.xml:1.4 datatypes.py:1.5
Fred L. Drake, Jr.
fred@zope.com
Wed, 22 Jan 2003 15:38:46 -0500
Update of /cvs-repository/ZODB3/zLOG
In directory cvs.zope.org:/tmp/cvs-serv21677/zLOG
Modified Files:
component.xml datatypes.py
Log Message:
Change the name "logger" to "eventlog". Also rename the loghandler section
types.
=== ZODB3/zLOG/component.xml 1.3 => 1.4 ===
--- ZODB3/zLOG/component.xml:1.3 Mon Jan 20 18:25:09 2003
+++ ZODB3/zLOG/component.xml Wed Jan 22 15:38:13 2003
@@ -27,14 +27,14 @@
datatype=".log_format"/>
</sectiontype>
- <sectiontype name="nteventlog" datatype=".nteventlog_handler"
+ <sectiontype name="win32-eventlog" datatype=".nteventlog_handler"
implements="loghandler" extends="base-log-handler">
<key name="appname" default="Zope"/>
<key name="format" default="%(message)s"
datatype=".log_format"/>
</sectiontype>
- <sectiontype name="http_handler" datatype=".http_handler"
+ <sectiontype name="http-logger" datatype=".http_handler"
implements="loghandler" extends="base-log-handler">
<key name="url" default="localhost" datatype=".http_handler_url"/>
<key name="method" default="GET" datatype=".get_or_post"/>
@@ -42,7 +42,7 @@
datatype=".log_format"/>
</sectiontype>
- <sectiontype name="smtp_handler" datatype=".smtp_handler"
+ <sectiontype name="email-notifier" datatype=".smtp_handler"
implements="loghandler" extends="base-log-handler">
<key name="fromaddr" required="yes"/>
<multikey name="toaddr" required="yes" attribute="toaddrs"/>
@@ -52,17 +52,8 @@
datatype=".log_format"/>
</sectiontype>
-<!--
- <sectiontype name="custom_handler" datatype=".custom_handler"
- implements="loghandler">
- <key name="constructor" datatype="constructor" required="yes"/>
- <key name="formatter" datatype="constructor"
- default="logging.Formatter()"/>
- <key name="level" default="info" datatype=".logging_level"/>
- </sectiontype>
--->
- <sectiontype name="logger" datatype=".logger">
+ <sectiontype name="eventlog" datatype=".EventLogFactory">
<key name="level" datatype=".logging_level" default="all"/>
<multisection type="loghandler" attribute="handlers" name="*"/>
</sectiontype>
=== ZODB3/zLOG/datatypes.py 1.4 => 1.5 ===
--- ZODB3/zLOG/datatypes.py:1.4 Mon Jan 20 18:25:09 2003
+++ ZODB3/zLOG/datatypes.py Wed Jan 22 15:38:13 2003
@@ -211,25 +211,10 @@
section.toaddrs,
section.subject)
-## def custom_handler(section):
-## formatter_klass, formatter_pos, formatter_kw = section.formatter
-## handler_klass, handler_pos, handler_kw = section.constructor
-## level = section.level
-
-## formatter = Factory(formatter_klass, None, formatter_pos, formatter_kw)
-
-## def callback(inst, formatter=formatter, level=level):
-## inst.setFormatter(formatter())
-## inst.setLevel(level)
-
-## return Factory(handler_klass, callback, *handler_pos, **handler_kw)
-
-def logger(section):
- return LoggerWrapper(section.level, section.handlers)
_marker = []
-class LoggerWrapper:
+class EventLogFactory:
"""
A wrapper used to create loggers while delaying actual logger
instance construction. We need to do this because we may
@@ -238,9 +223,9 @@
An instance of this wrapper is a callable which, when called, returns a
logger object.
"""
- def __init__(self, level, handler_factories):
- self.level = level
- self.handler_factories = handler_factories
+ def __init__(self, section):
+ self.level = section.level
+ self.handler_factories = section.handlers
self.resolved = _marker
def __call__(self):