Skip to content

Commit

Permalink
logger: Use sphinx.util.logger
Browse files Browse the repository at this point in the history
Do not use warnings.warn anymore since they yield obnoxiously formatted
warnings, instead, always use sphinx.util.logger (or logging if outside
a sphinx context).

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
  • Loading branch information
gastmaier committed Nov 22, 2024
1 parent f8feacf commit a4f8789
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 82 deletions.
3 changes: 0 additions & 3 deletions adi_doctools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from os import path, getenv
from packaging.version import Version

from sphinx.util import logging
from sphinx.util.osutil import SEP

from .theme import (navigation_tree, get_pygments_theme,
Expand All @@ -15,8 +14,6 @@

__version__ = "0.3.49"

logger = logging.getLogger(__name__)


def get_navigation_tree(app, context, pagename):
# The navigation tree, generated from the sphinx-provided ToC tree.
Expand Down
4 changes: 3 additions & 1 deletion adi_doctools/directive/hdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from os import pardir, makedirs
from math import ceil
from lxml import etree
from sphinx.util import logging

from .node import node_div
from .common import logger
from .common import directive_base
from .common import parse_rst
from .string import string_hdl
Expand All @@ -17,6 +17,8 @@
from ..parser.hdl import parse_hdl_build_status
from ..writer.hdl_component import hdl_component

logger = logging.getLogger(__name__)


log = {
'signal': "{lib}/component.xml: Signal {signal} defined in the hdl-interfaces directive does not exist in the IP-XACT!", # noqa: E501
Expand Down
Loading

0 comments on commit a4f8789

Please sign in to comment.