[Zope3-checkins] CVS: Zope/lib/python/ZConfig/components/logger -
base-logger.xml:1.1 eventlog.xml:1.1 component.xml:1.2
logger.py:1.3 logger.xml:1.4
Fred L. Drake, Jr.
fred at zope.com
Tue Apr 13 10:09:17 EDT 2004
Update of /cvs-repository/Zope/lib/python/ZConfig/components/logger
In directory cvs.zope.org:/tmp/cvs-serv8563/components/logger
Modified Files:
component.xml logger.py logger.xml
Added Files:
base-logger.xml eventlog.xml
Log Message:
Refactored the schema components for ZConfig.components.logger so that a schema
can import just one of eventlog and logger if desired. This is needed for
Zope 2 to allow the main Zope configuration to only use eventlog, since the
name "logger" is used for something else.
=== Added File Zope/lib/python/ZConfig/components/logger/base-logger.xml ===
<component prefix="ZConfig.components.logger.logger">
<import package="ZConfig.components.logger" file="abstract.xml"/>
<sectiontype name="ZConfig.logger.base-logger">
<description>
Base definition for the logger types defined by
ZConfig.components.logger. This exists entirely to provide
shared key definitions and documentation.
</description>
<key name="level"
datatype="ZConfig.components.logger.datatypes.logging_level"
default="info">
<description>
Verbosity setting for the logger. Values must be a name of
a level, or an integer in the range [0..50]. The names of the
levels, in order of increasing verbosity (names on the same
line are equivalent):
critical, fatal
error
warn, warning
info
blather
debug
trace
all
The special name "notset", or the numeric value 0, indicates
that the setting for the parent logger should be used.
It is strongly recommended that names be used rather than
numeric values to ensure that configuration files can be
deciphered more easily.
</description>
</key>
<multisection type="ZConfig.logger.handler"
attribute="handlers" name="*">
<description>
Handlers to install on this logger. Each handler describes
how logging events should be presented.
</description>
</multisection>
</sectiontype>
</component>
=== Added File Zope/lib/python/ZConfig/components/logger/eventlog.xml ===
<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="eventlog"
datatype=".EventLogFactory"
extends="ZConfig.logger.base-logger"
implements="ZConfig.logger.log">
<description>
Configuration for the root logger.
</description>
</sectiontype>
</component>
=== Zope/lib/python/ZConfig/components/logger/component.xml 1.1 => 1.2 ===
--- Zope/lib/python/ZConfig/components/logger/component.xml:1.1 Fri Jan 2 13:46:12 2004
+++ Zope/lib/python/ZConfig/components/logger/component.xml Tue Apr 13 10:08:44 2004
@@ -5,5 +5,6 @@
<import package="ZConfig.components.logger" file="abstract.xml"/>
<import package="ZConfig.components.logger" file="handlers.xml"/>
<import package="ZConfig.components.logger" file="logger.xml"/>
+ <import package="ZConfig.components.logger" file="eventlog.xml"/>
</component>
=== Zope/lib/python/ZConfig/components/logger/logger.py 1.2 => 1.3 ===
--- Zope/lib/python/ZConfig/components/logger/logger.py:1.2 Fri Apr 9 17:21:58 2004
+++ Zope/lib/python/ZConfig/components/logger/logger.py Tue Apr 13 10:08:44 2004
@@ -51,6 +51,15 @@
# make sure we've instantiated the logger
self()
+ def getLowestHandlerLevel(self):
+ """Return the lowest log level provided by any configured handler."""
+ lowest = self.level
+ for factory in self.handler_factories:
+ handler_level = factory.getLevel()
+ if handler_level < lowest:
+ lowest = factory.getLevel()
+ return lowest
+
class EventLogFactory(LoggerFactoryBase):
"""Logger factory that returns the root logger."""
=== Zope/lib/python/ZConfig/components/logger/logger.xml 1.3 => 1.4 ===
--- Zope/lib/python/ZConfig/components/logger/logger.xml:1.3 Fri Apr 9 17:33:08 2004
+++ Zope/lib/python/ZConfig/components/logger/logger.xml Tue Apr 13 10:08:44 2004
@@ -3,42 +3,8 @@
</description>
<import package="ZConfig.components.logger" file="abstract.xml"/>
-
- <sectiontype name="ZConfig.logger.base-logger">
- <key name="level"
- datatype="ZConfig.components.logger.datatypes.logging_level"
- default="info">
- <description>
- Verbosity setting for the logger. Values must be a name of
- a level, or an integer in the range [0..50]. The names of the
- levels, in order of increasing verbosity (names on the same
- line are equivalent):
-
- critical, fatal
- error
- warn, warning
- info
- blather
- debug
- trace
- all
-
- The special name "notset", or the numeric value 0, indicates
- that the setting for the parent logger should be used.
-
- It is strongly recommended that names be used rather than
- numeric values to ensure that configuration files can be
- deciphered more easily.
- </description>
- </key>
- <multisection type="ZConfig.logger.handler"
- attribute="handlers" name="*">
- <description>
- Handlers to install on this logger. Each handler describes
- how logging events should be presented.
- </description>
- </multisection>
- </sectiontype>
+ <import package="ZConfig.components.logger" file="base-logger.xml"/>
+ <import package="ZConfig.components.logger" file="eventlog.xml"/>
<sectiontype name="logger"
datatype=".LoggerFactory"
@@ -68,15 +34,6 @@
actually interesting for the application.
</description>
</key>
- </sectiontype>
-
- <sectiontype name="eventlog"
- datatype=".EventLogFactory"
- extends="ZConfig.logger.base-logger"
- implements="ZConfig.logger.log">
- <description>
- Configuration for the root logger.
- </description>
</sectiontype>
</component>
More information about the Zope3-Checkins
mailing list