diff options
| author | Michael E Brown <michael_e_brown@dell.com> | 2007-11-29 12:46:06 -0600 |
|---|---|---|
| committer | Michael E Brown <michael_e_brown@dell.com> | 2007-11-29 12:46:06 -0600 |
| commit | e67ee4ff2b310895dcc1dc4d371fa31af966f1da (patch) | |
| tree | 382ad182116b1f3eae232c34de251c15235400ac /src | |
| parent | 2cb4d247a1c3cf7bebf5e68ffad51005012f2d44 (diff) | |
| download | mock-e67ee4ff2b310895dcc1dc4d371fa31af966f1da.tar.gz mock-e67ee4ff2b310895dcc1dc4d371fa31af966f1da.tar.xz mock-e67ee4ff2b310895dcc1dc4d371fa31af966f1da.zip | |
basic logger config a bit earlier so we can possibly catch log messages from submodule imports.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/mock.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mock.py b/src/mock.py index d8000be..4789537 100755 --- a/src/mock.py +++ b/src/mock.py @@ -40,6 +40,11 @@ MOCKCONFDIR= SYSCONFDIR + "/mock" # import all mock.* modules after this. sys.path.insert(0,PYTHONDIR) +# set up basic logging until config file can be read +FORMAT = "%(levelname)s: %(message)s" +logging.basicConfig(format=FORMAT, level=logging.WARNING) +log = logging.getLogger() + # our imports import mock.exception from mock.trace_decorator import traceLog @@ -47,12 +52,6 @@ import mock.backend import mock.uid import mock.util -# set up basic logging until config file can be read -log = logging.getLogger() -FORMAT = "%(message)s" -logging.basicConfig(format=FORMAT, level=logging.ERROR) - -@traceLog(log) def command_parse(config_opts): """return options and args from parsing the command line""" @@ -290,7 +289,7 @@ def main(retParams): if options.chroot == "default": log.error(" Did you forget to specify the chroot to use with '-r'?") sys.exit(1) - # reconfigure logging in case config file was overridden + # configure logging config_opts['chroot_name'] = options.chroot log_ini = os.path.join(config_path, config_opts["log_config_file"]) if not os.path.exists(log_ini): |
