diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-06 23:36:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-06 23:36:17 +0000 |
| commit | b67a752444be399bc0000069b2c60eee3ab94dad (patch) | |
| tree | 8728ac74f8e89f461e3cb6e1611404264f0701e0 /openstack/common | |
| parent | 78941d4c89b2d23930520197756d4e65e58d1749 (diff) | |
| parent | 9b8128910787ac5f3e80ab81266d971ff20d1805 (diff) | |
| download | oslo-b67a752444be399bc0000069b2c60eee3ab94dad.tar.gz oslo-b67a752444be399bc0000069b2c60eee3ab94dad.tar.xz oslo-b67a752444be399bc0000069b2c60eee3ab94dad.zip | |
Merge "Allow nova and others to override some logging defaults"
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/cfg.py | 7 | ||||
| -rw-r--r-- | openstack/common/log.py | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py index acef6fb..99d4aa2 100644 --- a/openstack/common/cfg.py +++ b/openstack/common/cfg.py @@ -480,6 +480,13 @@ def _is_opt_registered(opts, opt): return False +def set_defaults(opts, **kwargs): + for opt in opts: + if opt.dest in kwargs: + opt.default = kwargs[opt.dest] + break + + class Opt(object): """Base class for all configuration options. diff --git a/openstack/common/log.py b/openstack/common/log.py index 8469fe8..707a10a 100644 --- a/openstack/common/log.py +++ b/openstack/common/log.py @@ -289,6 +289,12 @@ def setup(product_name): _setup_logging_from_conf(product_name) +def set_defaults(logging_context_format_string): + cfg.set_defaults(log_opts, + logging_context_format_string= + logging_context_format_string) + + def _find_facility_from_conf(): facility_names = logging.handlers.SysLogHandler.facility_names facility = getattr(logging.handlers.SysLogHandler, |
