From 9b08638a2b25b5ec38dc4091eefd73de0edfbe4f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:51:32 +0100 Subject: Improve debug logging in load/download method --- module/plugins/Plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins') 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() -- cgit v1.2.3