[Zodb-checkins] CVS: Zope/lib/python/ZConfig/components/logger -
Fred L. Drake, Jr.
fred at zope.com
Tue Apr 13 13:02:55 EDT 2004
Update of /cvs-repository/Zope/lib/python/ZConfig/components/logger
In directory cvs.zope.org:/tmp/cvs-serv9927
add a reopen() method to the factory to allow FileHandlers to be
reopened when rotating logs
=== Zope/lib/python/ZConfig/components/logger/logger.py 1.3 => 1.4 ===
--- Zope/lib/python/ZConfig/components/logger/logger.py:1.3 Tue Apr 13 10:08:44 2004
+++ Zope/lib/python/ZConfig/components/logger/logger.py Tue Apr 13 13:02:53 2004
@@ -60,6 +60,20 @@
lowest = factory.getLevel()
+ def reopen(self):
+ """Re-open any handlers for which this is a meaningful operation.
+ This only works on handlers on the logger provided by this
+ factory directly; handlers for child loggers are not affected.
+ (This can be considered a bug, but is sufficient at the
+ logger = self()
+ for handler in logger.handlers:
+ reopen = getattr(handler, "reopen", None)
+ if reopen is not None and callable(reopen):
"""Logger factory that returns the root logger."""
More information about the Zodb-checkins