diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2013-12-13 13:05:28 -0600 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2013-12-13 13:08:12 -0600 |
commit | 9b07e20dee4c1fc7baa980dc2bed6cf76aab4287 (patch) | |
tree | ec97f1191c7b62cd84d12dca16e6c17a03957b77 | |
parent | f6aa72334c04bba3b24191f898d10da6d6190be6 (diff) | |
download | keystone-9b07e20dee4c1fc7baa980dc2bed6cf76aab4287.tar.gz |
Refactor setup_logging
This change just cleans up the setup_logging function. It was
defined in keystone.common.config and then also exported from
keystone.config. Also, it had extra parameters that were unused.
This takes care of a NOTE (which probably should have been a
TODO) in the code.
Change-Id: I1a46c8974cbd68a5bf708d253adfadc1fdb76dcd
-rwxr-xr-x | bin/keystone-all | 2 | ||||
-rw-r--r-- | httpd/keystone.py | 2 | ||||
-rw-r--r-- | keystone/cli.py | 2 | ||||
-rw-r--r-- | keystone/common/config.py | 15 | ||||
-rw-r--r-- | keystone/config.py | 7 |
5 files changed, 9 insertions, 19 deletions
diff --git a/bin/keystone-all b/bin/keystone-all index 18e2a1ce3..9354688c5 100755 --- a/bin/keystone-all +++ b/bin/keystone-all @@ -104,7 +104,7 @@ if __name__ == '__main__': version=pbr.version.VersionInfo('keystone').version_string(), default_config_files=config_files) - config.setup_logging(CONF, product_name='keystone') + config.setup_logging() # Log the options used when starting if we're in debug mode... if CONF.debug: diff --git a/httpd/keystone.py b/httpd/keystone.py index aa057136c..dd3c2f93d 100644 --- a/httpd/keystone.py +++ b/httpd/keystone.py @@ -33,7 +33,7 @@ from keystone.openstack.common import log CONF = config.CONF CONF(project='keystone') -config.setup_logging(CONF) +config.setup_logging() environment.use_stdlib() name = os.path.basename(__file__) diff --git a/keystone/cli.py b/keystone/cli.py index eaf6e1020..fc0ac6c14 100644 --- a/keystone/cli.py +++ b/keystone/cli.py @@ -215,5 +215,5 @@ def main(argv=None, config_files=None): version=pbr.version.VersionInfo('keystone').version_string(), usage='%(prog)s [' + '|'.join([cmd.name for cmd in CMDS]) + ']', default_config_files=config_files) - config.setup_logging(CONF) + config.setup_logging() CONF.command.cmd_class.main() diff --git a/keystone/common/config.py b/keystone/common/config.py index 1db8172cd..ca14b81bc 100644 --- a/keystone/common/config.py +++ b/keystone/common/config.py @@ -16,8 +16,6 @@ from oslo.config import cfg -from keystone.openstack.common import log as logging - _DEFAULT_LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s" _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -277,19 +275,6 @@ FILE_OPTIONS = { CONF = cfg.CONF -def setup_logging(conf, product_name='keystone'): - """Sets up the logging options for a log with supplied name - - :param conf: a cfg.ConfOpts object - """ - # NOTE(ldbragst): This method will be removed along with other - # refactoring in favor of using the - # keystone/openstack/common/log.py implementation. This just ensures - # that in the time between introduction and refactoring, we still have - # a working logging implementation. - logging.setup(product_name) - - def setup_authentication(conf=None): # register any non-default auth methods here (used by extensions, etc) if conf is None: diff --git a/keystone/config.py b/keystone/config.py index dd0f02557..aa6df2254 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -19,16 +19,21 @@ import os from keystone.common import config from keystone import exception +from keystone.openstack.common import log config.configure() CONF = config.CONF -setup_logging = config.setup_logging setup_authentication = config.setup_authentication configure = config.configure +def setup_logging(): + """Sets up logging for the keystone package.""" + log.setup('keystone') + + def find_paste_config(): """Find Keystone's paste.deploy configuration file. |