Merge "Add oslo.config option for split-loggers"

This commit is contained in:
Zuul 2018-05-17 21:06:52 +00:00 committed by Gerrit Code Review
commit c3ef1a11b5
3 changed files with 13 additions and 0 deletions

View File

@ -147,6 +147,7 @@ class Session(base.BaseLoader):
:insecure: Whether to ignore SSL verification.
:timeout: The max time to wait for HTTP connections.
:collect-timing: Whether to collect API timing information.
:split-loggers: Whether to log requests to multiple loggers.
:param dict deprecated_opts: Deprecated options that should be included
in the definition of new options. This should be a dict from the
@ -188,6 +189,11 @@ class Session(base.BaseLoader):
'collect-timing'),
default=False,
help='Collect per-API call timing information.'),
cfg.BoolOpt('split-loggers',
deprecated_opts=deprecated_opts.get(
'split-loggers'),
default=False,
help='Log requests to multiple loggers.')
]
def register_conf_options(self, conf, group, deprecated_opts=None):
@ -200,6 +206,7 @@ class Session(base.BaseLoader):
:insecure: Whether to ignore SSL verification.
:timeout: The max time to wait for HTTP connections.
:collect-timing: Whether to collect API timing information.
:split-loggers: Whether to log requests to multiple loggers.
:param oslo_config.Cfg conf: config object to register with.
:param string group: The ini group to register options in.
@ -242,6 +249,7 @@ class Session(base.BaseLoader):
kwargs.setdefault('key', c.keyfile)
kwargs.setdefault('timeout', c.timeout)
kwargs.setdefault('collect_timing', c.collect_timing)
kwargs.setdefault('split_loggers', c.split_loggers)
return self.load_from_options(**kwargs)

View File

@ -77,6 +77,7 @@ class ConfLoadingTests(utils.TestCase):
'insecure',
'timeout',
'collect-timing',
'split-loggers',
]
depr = dict([(n, [new_deprecated()]) for n in opt_names])
opts = loading.get_session_conf_options(deprecated_opts=depr)

View File

@ -0,0 +1,4 @@
---
features:
- |
Added ``split-loggers`` option to the oslo.config Session options.