diff --git a/doc/changelog.txt b/doc/changelog.txt
index e99fbeae..88cd5a1e 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,5 +1,8 @@
6.6 "" (released xx.xx.2011)
+Changes:
+- logging: Add warning tag attribute in XML loggers.
+
6.5 "The Abyss" (released 13.3.2011)
diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py
index 435b4719..672cc370 100644
--- a/linkcheck/checker/urlbase.py
+++ b/linkcheck/checker/urlbase.py
@@ -1083,7 +1083,7 @@ class UrlBase (object):
Indicates if URL data has been loaded from cache.
- url_data.result: unicode
Result string
- - url_data.warnings: list of unicode
+ - url_data.warnings: list of tuples (tag, warning message)
List of tagged warnings for this URL.
- url_data.name: unicode string or None
name of URL (eg. filename or link name)
@@ -1116,7 +1116,7 @@ class UrlBase (object):
extern=self.extern[0],
cached=self.cached,
result=self.result,
- warnings=[x[1] for x in self.warnings],
+ warnings=self.warnings[:],
name=self.name or u"",
title=self.get_title(),
parent_url=self.parent_url or u"",
diff --git a/linkcheck/logger/csvlog.py b/linkcheck/logger/csvlog.py
index 355cbec4..1e049710 100644
--- a/linkcheck/logger/csvlog.py
+++ b/linkcheck/logger/csvlog.py
@@ -88,7 +88,7 @@ class CSVLogger (Logger):
for s in (url_data.base_url,
url_data.parent_url, url_data.base_ref,
url_data.result,
- self.linesep.join(url_data.warnings),
+ self.linesep.join(x[1] for x in url_data.warnings),
self.linesep.join(url_data.info),
url_data.valid, url_data.url,
url_data.line, url_data.column,
diff --git a/linkcheck/logger/customxml.py b/linkcheck/logger/customxml.py
index e94ef9f0..7e621892 100644
--- a/linkcheck/logger/customxml.py
+++ b/linkcheck/logger/customxml.py
@@ -71,8 +71,9 @@ class CustomXMLLogger (xmllog.XMLLogger):
self.xml_endtag(u"infos")
if url_data.warnings and self.has_part('warning'):
self.xml_starttag(u"warnings")
- for data in url_data.warnings:
- self.xml_tag(u"warning", data)
+ for tag, data in url_data.warnings:
+ attrs = {"tag": tag}
+ self.xml_tag(u"warning", data, attrs)
self.xml_endtag(u"warnings")
if self.has_part("result"):
attrs = {}
diff --git a/linkcheck/logger/html.py b/linkcheck/logger/html.py
index bd03d44d..32de3815 100644
--- a/linkcheck/logger/html.py
+++ b/linkcheck/logger/html.py
@@ -220,7 +220,7 @@ class HtmlLogger (Logger):
def write_warning (self, url_data):
"""Write url_data.warnings."""
sep = u"
"+os.linesep
- text = sep.join(cgi.escape(x) for x in url_data.warnings)
+ text = sep.join(cgi.escape(x[1]) for x in url_data.warnings)
self.writeln(u'