Update sphinx extension logging

Sphinx 1.6 deprecated using the application object to perform logging
and it will be removed in the upcoming 2.0 release. This updates our
extensions to use the recommended sphinx.util.logging instead.

Change-Id: I3abce4e3c147befd0235820cb8850fe18f6dee42
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Sean McGinnis 5 years ago
parent e878df1a16
commit 87ca0d72fa

@ -16,10 +16,12 @@ from docutils import nodes
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils.statemachine import ViewList
from sphinx.util import logging
from sphinx.util.nodes import nested_parse_with_titles
from stevedore import extension
LOG = logging.getLogger(__name__)
class ListAuthPluginsDirective(rst.Directive):
"""Present a simple list of the plugins in a namespace."""
@ -32,12 +34,8 @@ class ListAuthPluginsDirective(rst.Directive):
has_content = True
def app(self):
return self.state.document.settings.env.app
def report_load_failure(mgr, ep, err):
self.app.warn(u'Failed to load %s: %s' % (ep.module_name, err))
LOG.warning(u'Failed to load %s: %s' % (ep.module_name, err))
def display_plugin(self, ext):
overline_style = self.options.get('overline-style', '')
@ -89,5 +87,5 @@ class ListAuthPluginsDirective(rst.Directive):
def setup(app):
app.info('loading keystoneauth1 plugins')
LOG.info('loading keystoneauth1 plugins')
app.add_directive('list-auth-plugins', ListAuthPluginsDirective)