Commit a45f4129 authored by Fred Drake's avatar Fred Drake

zLOG is the past; logging is the future. Configure the right thing.

parent 23223c9c
......@@ -606,26 +606,12 @@ def main(module_filter, test_filter, libdir):
os.path.walk(os.curdir, remove_stale_bytecode, None)
global pathinit
# Get the log.ini file from the current directory instead of possibly
# buried in the build directory. XXX This isn't perfect because if
# log.ini specifies a log file, it'll be relative to the build directory.
# Hmm...
logini = os.path.abspath('log.ini')
configure_logging()
# Initialize the path and cwd
pathinit = PathInit(build, libdir)
# Initialize the logging module.
import logging.config
logging.basicConfig()
level = os.getenv("LOGGING")
if level:
level = int(level)
else:
level = logging.CRITICAL
logging.root.setLevel(level)
files = find_tests(module_filter)
files.sort()
......@@ -650,6 +636,26 @@ def main(module_filter, test_filter, libdir):
runner(files, test_filter, debug)
def configure_logging():
"""Initialize the logging module."""
import logging.config
# Get the log.ini file from the current directory instead of possibly
# buried in the build directory. XXX This isn't perfect because if
# log.ini specifies a log file, it'll be relative to the build directory.
# Hmm...
logini = os.path.abspath("log.ini")
if os.path.exists(logini):
logging.config.fileConfig(logini)
else:
logging.basicConfig()
if os.environ.has_key("LOGGING"):
level = int(os.environ["LOGGING"])
logging.getLogger().setLevel(level)
def process_args(argv=None):
import getopt
global module_filter
......
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