Log ignored warning messages as info

This commit is contained in:
Chris Mayo 2023-08-28 19:22:24 +01:00
parent 77da1c1b01
commit 4d9749c5ba
3 changed files with 7 additions and 6 deletions

View file

@ -3,6 +3,7 @@
Changes:
- Minimum Python version required is 3.8
- HTTP redirect causes a warning, http-redirected
- Ignored warning messages are logged as information
10.2.1 (released 05.12.2022)

View file

@ -116,7 +116,7 @@ filtering
Command line option: :option:`--ignore-url`
**ignorewarnings=**\ *NAME*\ [**,**\ *NAME*...]
Ignore the comma-separated list of warnings. See `WARNINGS`_ for
the list of supported warnings.
the list of supported warnings. Messages are logged as information.
Command line option: none
**internlinks=**\ *REGEX*
Regular expression to add more URLs recognized as internal links.

View file

@ -384,11 +384,11 @@ class UrlBase:
Add a warning string.
"""
item = (tag, s)
if (
item not in self.warnings
and tag not in self.aggregate.config["ignorewarnings"]
):
self.warnings.append(item)
if item not in self.warnings:
if tag in self.aggregate.config["ignorewarnings"]:
self.add_info(s)
else:
self.warnings.append(item)
def add_info(self, s):
"""