Commit cc6c1ff2 authored by Guido van Rossum's avatar Guido van Rossum

Use the automatic <logger> section processing from zdoptions.

parent feebb73e
...@@ -87,22 +87,11 @@ class ZEOOptionsMixin: ...@@ -87,22 +87,11 @@ class ZEOOptionsMixin:
self.add("monitor_address", None, "m:", "monitor=", self.add("monitor_address", None, "m:", "monitor=",
self.handle_monitor_address) self.handle_monitor_address)
def load_logconf(self):
if self.configroot.logger is not None:
zLOG.set_initializer(self.log_initializer)
zLOG.initialize()
def log_initializer(self):
from zLOG import EventLogger
logger = self.configroot.logger()
for handler in logger.handlers:
if hasattr(handler, "reopen"):
handler.reopen()
EventLogger.event_logger.logger = logger
class ZEOOptions(ZDOptions, ZEOOptionsMixin): class ZEOOptions(ZDOptions, ZEOOptionsMixin):
logsectionname = "logger"
def __init__(self): def __init__(self):
self.schemadir = os.path.dirname(__file__) self.schemadir = os.path.dirname(__file__)
ZDOptions.__init__(self) ZDOptions.__init__(self)
...@@ -110,11 +99,6 @@ class ZEOOptions(ZDOptions, ZEOOptionsMixin): ...@@ -110,11 +99,6 @@ class ZEOOptions(ZDOptions, ZEOOptionsMixin):
self.add("storages", "storages", self.add("storages", "storages",
required="no storages specified; use -f or -C") required="no storages specified; use -f or -C")
def realize(self, *args):
ZDOptions.realize(self, *args)
if self.configroot is not None:
self.load_logconf()
class ZEOServer: class ZEOServer:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment