Commit b6f1ef85 authored by Chris McDonough's avatar Chris McDonough

Refactor start_zope function and add tests for its functionality.

Changes:

 - startup log handler now pays attention to the logging levels of
   the handlers defined within the config file and uses the "lowest"
   level to log messages to stdout during startup.

 - entirely removed warning when the starting user's umask is "too
   permissive".  it wasn't clear that it added any value under normal
   operations.

 - replaced ancient setuid code with code stolen from zdaemon that
   works the same but looks nicer.
parent 4dd77650
......@@ -97,6 +97,9 @@ class HandlerFactory(Factory):
logger.setLevel(self.section.level)
return logger
def getLevel(self):
return self.section.level
class FileHandlerFactory(HandlerFactory):
def create_loghandler(self):
from zLOG.LogHandlers import StreamHandler, FileHandler
......@@ -224,3 +227,14 @@ class EventLogFactory(Factory):
from zLOG.LogHandlers import NullHandler
logger.addHandler(NullHandler())
return logger
def getLowestHandlerLevel(self):
""" Return the lowest log level provided by any of our handlers
(used by Zope startup logger code to decide what to send
to stderr during startup) """
lowest = self.level
for factory in self.handler_factories:
handler_level = factory.getLevel()
if handler_level < lowest:
lowest = factory.getLevel()
return lowest
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