Add docutils type, to warnings originating from docutils (#12550)

As per other warning types, this helps users to better understand the root of the problem.
This commit is contained in:
Chris Sewell 2024-07-12 19:02:44 +02:00 committed by GitHub
parent 9234d0b08d
commit 316451de81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -330,11 +330,11 @@ class WarningStream:
def write(self, text: str) -> None:
matched = report_re.search(text)
if not matched:
logger.warning(text.rstrip("\r\n"))
logger.warning(text.rstrip("\r\n"), type="docutils")
else:
location, type, level = matched.groups()
message = report_re.sub('', text).rstrip()
logger.log(type, message, location=location)
logger.log(type, message, location=location, type="docutils")
class LoggingReporter(Reporter):