Merge pull request #1002 from adamcik/fix/694

config: Debug log ignored sections (fixes: #694)
This commit is contained in:
Stein Magnus Jodal 2015-02-25 23:36:13 +01:00
commit 635ee6e4eb
2 changed files with 8 additions and 0 deletions

View File

@ -48,6 +48,8 @@ v0.20.0 (UNRELEASED)
This can be used to show absolutely all log records, including those at
custom levels below ``DEBUG``.
- Add debug logging of unknown sections. (Fixes: :issue:`694`)
**Logging**
- Add custom log level ``TRACE`` (numerical level 5), which can be used by

View File

@ -177,13 +177,19 @@ def _validate(raw_config, schemas):
# Get validated config
config = {}
errors = {}
sections = set(raw_config)
for schema in schemas:
sections.discard(schema.name)
values = raw_config.get(schema.name, {})
result, error = schema.deserialize(values)
if error:
errors[schema.name] = error
if result:
config[schema.name] = result
for section in sections:
logger.debug('Ignoring unknown config section: %s', section)
return config, errors