summaryrefslogtreecommitdiffstats
path: root/module/plugins/Plugin.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-28 04:51:32 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-28 04:51:32 +0100
commit9b08638a2b25b5ec38dc4091eefd73de0edfbe4f (patch)
tree7d59d618538d7ec4be0c592bdff4a17f333882a4 /module/plugins/Plugin.py
parentNew hoster plugin UpleaCom (diff)
downloadpyload-9b08638a2b25b5ec38dc4091eefd73de0edfbe4f.tar.xz
Improve debug logging in load/download method
Diffstat (limited to 'module/plugins/Plugin.py')
-rw-r--r--module/plugins/Plugin.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 42bff9276..11e1a06dd 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -449,7 +449,9 @@ class Plugin(Base):
if type(url) == unicode:
url = str(url) # encode('utf8')
- self.logDebug("Load url", *["%s: %s" % (key, val) for key, val in locals().items()])
+ if self.core.debug:
+ kwargs = locals()
+ self.logDebug("Load url: " + kwargs['url'], *["%s=%s" % (key, val) for key, val in kwargs.iteritems() if key not in ("self", "url")])
res = self.req.load(url, get, post, ref, cookies, just_header, decode=decode)
@@ -509,7 +511,9 @@ class Plugin(Base):
:return: The location where the file was saved
"""
- self.logDebug("Download url", *["%s: %s" % (key, val) for key, val in locals().items()])
+ if self.core.debug:
+ kwargs = locals()
+ self.logDebug("Download url: " + kwargs['url'], *["%s=%s" % (key, val) for key, val in kwargs.iteritems() if key not in ("self", "url")])
self.checkForSameFiles()