Index: Tools/Scripts/webkitpy/w3c/test_parser.py |
diff --git a/Tools/Scripts/webkitpy/w3c/test_parser.py b/Tools/Scripts/webkitpy/w3c/test_parser.py |
index 65e55f128cc5f14ba52ae066dbbdb9ce595f0cfb..65148ed49f10c301d232c8bd54dfa71294b782df 100644 |
--- a/Tools/Scripts/webkitpy/w3c/test_parser.py |
+++ b/Tools/Scripts/webkitpy/w3c/test_parser.py |
@@ -27,12 +27,16 @@ |
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# SUCH DAMAGE. |
+import logging |
import re |
from webkitpy.common.host import Host |
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup as Parser |
+_log = logging.getLogger(__name__) |
+ |
+ |
class TestParser(object): |
def __init__(self, options, filename): |
@@ -51,12 +55,12 @@ class TestParser(object): |
self.test_doc = Parser(self.filesystem.read_binary_file(filename)) |
except: |
# FIXME: Figure out what to do if we can't parse the file. |
- print "Error: failed to parse %s" % filename |
+ _log.error("Failed to parse %s", filename) |
self.test_doc is None |
else: |
if self.filesystem.isdir(filename): |
# FIXME: Figure out what is triggering this and what to do about it. |
- print "Error: trying to load %s, which is a directory" % filename |
+ _log.error("Trying to load %s, which is a directory", filename) |
self.test_doc = None |
self.ref_doc = None |
@@ -79,13 +83,15 @@ class TestParser(object): |
matches = self.reference_links_of_type('match') + self.reference_links_of_type('mismatch') |
if matches: |
if len(matches) > 1: |
- print 'Warning: Webkit does not support multiple references. Importing the first ref defined in ' + self.filesystem.basename(self.filename) |
+ # FIXME: Is this actually true? We should fix this. |
+ _log.warning('Multiple references are not supported. Importing the first ref defined in %s', |
+ self.filesystem.basename(self.filename)) |
try: |
ref_file = self.filesystem.join(self.filesystem.dirname(self.filename), matches[0]['href']) |
except KeyError as e: |
# FIXME: Figure out what to do w/ invalid test files. |
- print "Error: %s is has a reference link but is missing the 'href'" % (self.filesystem) |
+ _log.error('%s is has a reference link but is missing the "href"', self.filesystem) |
return None |
if self.ref_doc is None: |