diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-12-22 13:41:56 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-01-02 12:59:50 +0900 |
commit | b43523fcbecda58ffd1ed31d29d0c9363a42be86 (patch) | |
tree | f5dc45705c4d1251503e602b4cdd4ec46341e87e /sphinx/ext/viewcode.py | |
parent | 70d6a560f2e23acbfaa85d1eda7471cfca15f77d (diff) | |
download | sphinx-git-b43523fcbecda58ffd1ed31d29d0c9363a42be86.tar.gz |
Use sphinx.util.logging instead app.info(), verbose(), debug() and debug2()
Diffstat (limited to 'sphinx/ext/viewcode.py')
-rw-r--r-- | sphinx/ext/viewcode.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index 813a465db..a4f93c144 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -19,7 +19,7 @@ import sphinx from sphinx import addnodes from sphinx.locale import _ from sphinx.pycode import ModuleAnalyzer -from sphinx.util import get_full_modname +from sphinx.util import get_full_modname, logging from sphinx.util.nodes import make_refnode from sphinx.util.console import blue # type: ignore @@ -29,6 +29,8 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA +logger = logging.getLogger(__name__) + def _get_full_modname(app, modname, attribute): # type: (Sphinx, str, unicode) -> unicode @@ -37,16 +39,16 @@ def _get_full_modname(app, modname, attribute): except AttributeError: # sphinx.ext.viewcode can't follow class instance attribute # then AttributeError logging output only verbose mode. - app.verbose('Didn\'t find %s in %s' % (attribute, modname)) + logger.verbose('Didn\'t find %s in %s' % (attribute, modname)) return None except Exception as e: # sphinx.ext.viewcode follow python domain directives. # because of that, if there are no real modules exists that specified # by py:function or other directives, viewcode emits a lot of warnings. # It should be displayed only verbose mode. - app.verbose(traceback.format_exc().rstrip()) - app.verbose('viewcode can\'t import %s, failed with error "%s"' % - (modname, e)) + logger.verbose(traceback.format_exc().rstrip()) + logger.verbose('viewcode can\'t import %s, failed with error "%s"' % + (modname, e)) return None |