diff --git a/doc/changelog.txt b/doc/changelog.txt index 8eb4ec63..72ff9cf8 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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) diff --git a/doc/src/man/linkcheckerrc.rst b/doc/src/man/linkcheckerrc.rst index 0493c2eb..b172c7b2 100644 --- a/doc/src/man/linkcheckerrc.rst +++ b/doc/src/man/linkcheckerrc.rst @@ -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. diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index 58212890..7134ded9 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -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): """