summaryrefslogtreecommitdiff
path: root/_exts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-09-25 18:26:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-09-25 18:26:50 +0200
commit24275f1c2280c33edf31640b41a4da5f64911681 (patch)
treeaade24f0ef06310f481587b3d82005dcafab01ea /_exts
parent25bf0d9c09713634bed5ccd2d3b673b0525c6e5d (diff)
downloaddocs-24275f1c2280c33edf31640b41a4da5f64911681.tar.gz
docs-24275f1c2280c33edf31640b41a4da5f64911681.tar.bz2
docs-24275f1c2280c33edf31640b41a4da5f64911681.zip
logging
Diffstat (limited to '_exts')
-rw-r--r--_exts/tsref.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/_exts/tsref.py b/_exts/tsref.py
index 9ff5893..980b9a5 100644
--- a/_exts/tsref.py
+++ b/_exts/tsref.py
@@ -36,10 +36,13 @@ from sphinx.pygments_styles import SphinxStyle
from pygments.formatters import HtmlFormatter
from docutils import nodes
from docutils.nodes import make_id
+from sphinx.util import logging
import re
import sys
+logger = logging.getLogger(__name__)
+
_escape_html_table = {
ord('&'): u'&amp;',
ord('<'): u'&lt;',
@@ -119,10 +122,6 @@ class MyHtmlBuilder(StandaloneHTMLBuilder):
self._current_docname = docname
super(MyHtmlBuilder, self).write_doc(docname, doctree)
- def warn(self, msg):
- print("warning:", msg, file=sys.stderr)
-
-
def get_annotation(tok, key):
if not hasattr(tok, "kv"):
return None
@@ -205,7 +204,7 @@ class LinkFilter(Filter):
tok_setprop(t, "href", href)
tok_setprop(t, "caption", caption)
else:
- self.app.builder.warn("unresolved link target in comment: " + id)
+ logger.warning("unresolved link target in comment: " + id)
yield t, m.group(1)
last = m.end()
post = value[last:]