diff --git a/docs/changelog.rst b/docs/changelog.rst index 7b3e97b0..e6e3bcf4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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 diff --git a/mopidy/config/__init__.py b/mopidy/config/__init__.py index 7c4f8755..f6fd2709 100644 --- a/mopidy/config/__init__.py +++ b/mopidy/config/__init__.py @@ -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