Add tracker host details to debug logging

This commit is contained in:
Calum Lind 2013-02-17 14:59:34 +00:00
parent 83df1159c0
commit 763af17e71
1 changed files with 6 additions and 5 deletions

View File

@ -213,7 +213,7 @@ class TrackerIcons(Component):
"""
if not url:
url = self.host_to_url(host)
log.debug("Downloading %s", url)
log.debug("Downloading %s %s", host, url)
return download_file(url, mkstemp()[1], force_filename=True)
def on_download_page_complete(self, page):
@ -275,6 +275,7 @@ class TrackerIcons(Component):
os.remove(page)
except Exception, e:
log.warning("Couldn't remove temp file: %s", e)
return parser.get_icons()
def on_parse_complete(self, icons, host):
@ -288,10 +289,10 @@ class TrackerIcons(Component):
:returns: the icons that were extracted from the page
:rtype: list
"""
log.debug("Got icons for %s: %s", host, icons)
log.debug("Parse Complete, got icons for %s: %s", host, icons)
url = self.host_to_url(host)
icons = [(urljoin(url, icon), mimetype) for icon, mimetype in icons]
log.debug("Icon urls: %s", icons)
log.debug("Icon urls from %s: %s", host, icons)
return icons
def on_parse_fail(self, f):
@ -362,7 +363,7 @@ class TrackerIcons(Component):
:returns: the icon that finished downloading
:rtype: TrackerIcon
"""
log.debug("Successfully downloaded: %s", icon_name)
log.debug("Successfully downloaded from %s: %s", host, icon_name)
icon = TrackerIcon(icon_name)
return icon
@ -381,7 +382,7 @@ class TrackerIcons(Component):
:rtype: Deferred or Failure
"""
error_msg = f.getErrorMessage()
log.debug("Error downloading icon: %s", error_msg)
log.debug("Error downloading icon from %s: %s", host, error_msg)
d = f
if f.check(PageRedirect):
# Handle redirect errors