From 6e4072fa725781fbfdfd2dd7833fee79daab4c69 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 16 Oct 2018 14:54:59 -0500 Subject: [PATCH] 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: I5a73a66decb88526b8be3a8fe4edca072e6dec2f Signed-off-by: Sean McGinnis --- doc/source/_exts/members.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/source/_exts/members.py b/doc/source/_exts/members.py index 80e3d0e..f07ade2 100644 --- a/doc/source/_exts/members.py +++ b/doc/source/_exts/members.py @@ -10,14 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. -"""Build a table of the current members -""" +"""Build a table of the current members""" import re from docutils import nodes from docutils.parsers.rst.directives.tables import Table from docutils.parsers.rst import directives +from sphinx.util import logging + +LOG = logging.getLogger(__name__) # Full name (IRC) [expires in] {role} _PATTERN = re.compile('(?P.*)\s+\((?P.*)\)\s+\<(?P.*)\>\s+\[(?P.*)\](\s+\{(?P.*)\})?') # noqa @@ -33,7 +35,7 @@ def _parse_members_file(app, filename): continue m = _PATTERN.match(line) if not m: - app.warning('Could not parse line %d of %s: %r' % + LOG.warning('Could not parse line %d of %s: %r' % (linum, filename, line)) continue yield m.groupdict() @@ -152,5 +154,5 @@ class MembersTable(Table): def setup(app): - app.info('loading members extension') + LOG.info('loading members extension') app.add_directive('memberstable', MembersTable)