Commit 498a8e48 authored by Stefan H. Holek's avatar Stefan H. Holek

Merged Zope-2_8-branch -r40818:40819 into Zope-2_9-branch.

(Made sure logging is configured. Read $INSTANCE_HOME/log.ini if it exists.)
parent 5a762139
......@@ -58,8 +58,9 @@ _start = time.time()
def _configure_logging():
# Initialize the logging module
if not sys.modules.has_key('logging'):
import logging
import logging
root = logging.getLogger()
if not root.handlers:
logging.basicConfig()
def _configure_debug_mode():
......
......@@ -6,6 +6,7 @@ Unreleased
- installProduct() now becomes a noop if ZopeTestCase did not apply its
patches.
- Made the functional doc tests set the cookie related headers.
- Made sure logging is configured. Read $INSTANCE_HOME/log.ini if it exists.
0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
......
......@@ -62,11 +62,13 @@ class Configurator:
return
if self.zeo_instance_home:
self.setup_zeo_instance_home()
self.setup_logging()
else:
if self.instance_home:
self.setup_instance_home()
else:
self.detect_and_setup_instance_home()
self.setup_logging()
self.setup_custom_zodb()
def setup_zeo_instance_home(self):
......@@ -128,6 +130,13 @@ class Configurator:
os.environ['INSTANCE_HOME'] = INSTANCE_HOME = self.cwd
self.setconfig(instancehome=self.cwd)
def setup_logging(self):
'''If $INSTANCE_HOME/log.ini exists, load it.'''
logini = os.path.join(self.getconfig('instancehome'), 'log.ini')
if os.path.exists(logini):
import logging.config
logging.config.fileConfig(logini)
def add_instance(self, p):
'''Adds an INSTANCE_HOME directory to Products.__path__ and sys.path.'''
import Products
......
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