Skip to content

Commit

Permalink
Log ignored warning messages as info
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmayo committed Aug 28, 2023
1 parent 77da1c1 commit 4d9749c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion doc/src/man/linkcheckerrc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions linkcheck/checker/urlbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ def add_warning(self, s, tag=None):
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):
"""
Expand Down

0 comments on commit 4d9749c

Please sign in to comment.