Skip to content

Commit f07681f

Browse files
committed
fix: showing logger.info
1 parent 5c39b0c commit f07681f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/pyconverter/xml2py/ast_tree.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
else:
4141
pass
4242

43-
logging.getLogger("py_asciimath.utils").setLevel("CRITICAL")
43+
logger = logging.getLogger("py_asciimath.utils")
44+
logger.setLevel(logging.INFO)
4445

4546

4647
# common statements used within the docs to avoid duplication
@@ -874,7 +875,7 @@ def to_rst(self, indent="", max_length=100, links=None, base_url=None):
874875
"""Return a string to enable converting the element to an RST format."""
875876
key = f"{self.targetptr}"
876877
if (links or base_url) is None:
877-
logging.error("ERROR in the links or the base_url definitions - OLink class.")
878+
logger.error("ERROR in the links or the base_url definitions - OLink class.")
878879
if key in links:
879880
root_name, root_title, href, text = links[key]
880881
link = f"{base_url}{root_name}/{href}"
@@ -1572,7 +1573,7 @@ def __repr__(self):
15721573
def to_rst(self, indent="", max_length=100, links=None, base_url=None):
15731574
"""Return a string to enable converting the element to an RST format."""
15741575
if (links or base_url) is None:
1575-
logging.error(
1576+
logger.error(
15761577
"ERROR exists in the links or the 'base_url' definitions in the 'Link' class."
15771578
)
15781579
tail = " ".join([str(item) for item in self])
@@ -2559,10 +2560,10 @@ def multiple_args(self):
25592560
split_name[k + 1]
25602561
)
25612562
if name_iter_prev != name_iter_next:
2562-
logging.warning(
2563+
logger.warning(
25632564
f"The argument name is not consistent: {name_iter_prev} != {name_iter_next}" # noqa : E501
25642565
)
2565-
logging.info(
2566+
logger.info(
25662567
"Applying the longest name for the argument list as it's probably coming from a typography." # noqa : E501
25672568
)
25682569
if len(name_iter_prev) > len(name_iter_next):
@@ -3221,7 +3222,7 @@ def trail_replacer(match):
32213222
docstr = ponctuaction_whitespace(docstr, ",") # Remove extra whitespace before comma
32223223

32233224
if self.is_archived == True:
3224-
logging.info(f"{self.name} is an archived command.")
3225+
logger.info(f"{self.name} is an archived command.")
32253226
docstr = (
32263227
docstr
32273228
+ "\n\n.. warning::\n"

src/pyconverter/xml2py/utils/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
from lxml.html import fromstring
2828
import yaml
2929

30+
logger = logging.getLogger("py_asciimath.utils")
31+
logger.setLevel(logging.INFO)
32+
3033

3134
def parse_yaml(yaml_path: Path) -> dict:
3235
"""
@@ -86,10 +89,10 @@ def get_warning_command_dict(yaml_path: Path) -> dict:
8689
warning_command_dict[command] = [message]
8790

8891
if warning_command_dict == {}:
89-
logging.info("No warning commands found in the YAML file.")
92+
logger.info("No warning commands found in the YAML file.")
9093

9194
else:
92-
logging.info("Warning commands found in the YAML file.")
95+
logger.info("Warning commands found in the YAML file.")
9396

9497
return warning_command_dict
9598

0 commit comments

Comments
 (0)