Skip to content

Commit d9a1a09

Browse files
authored
Merge pull request #5 from coldfix/fix-logging
Fix AttributeError: 'Sphinx' object has no attribute 'debug'
2 parents 3dee804 + 194ca30 commit d9a1a09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autodocsumm/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
This extension gives also the possibility to choose which data shall be shown
1212
and to include the docstring of the ``'__call__'`` attribute.
1313
"""
14+
import logging
1415
import re
1516
import six
1617
import sphinx
@@ -57,6 +58,8 @@
5758

5859
sphinx_version = list(map(float, re.findall(r'\d+', sphinx.__version__)[:3]))
5960

61+
logger = logging.getLogger(__name__)
62+
6063

6164
class AutosummaryDocumenter(object):
6265
"""Abstract class for for extending Documenter methods
@@ -114,7 +117,7 @@ def get_grouped_documenters(self, all_members=False):
114117
# be cached anyway)
115118
self.analyzer.find_attr_docs()
116119
except PycodeError as err:
117-
self.env.app.debug('[autodoc] module analyzer failed: %s', err)
120+
logger.debug('[autodoc] module analyzer failed: %s', err)
118121
# no source file -- e.g. for builtin and C modules
119122
self.analyzer = None
120123
# at least add the module.__file__ as a dependency

0 commit comments

Comments
 (0)