diff --git a/discorss.py b/discorss.py index 49a7cfd..8513a97 100755 --- a/discorss.py +++ b/discorss.py @@ -164,6 +164,11 @@ class Discorss: ], # "timestamp": str(self.now), } + self.logger.debug( + "Checking for images in post %s from %s...", + latest_post["title"], + hook["name"], + ) image_url = self.get_image_url(latest_post) if image_url is not None: embed["thumbnail"] = {"url": image_url} @@ -303,7 +308,9 @@ class Discorss: match = self.img_src_filter.search(str(text)) if match and self.is_image_url(match.group(1)): image_candidates.append(match.group(1)) - + self.logger.debug("Found the following image candidates in %s...", feed["name"]) + for i in image_candidates: + self.logger.debug("%s", i) if len(image_candidates) > 0: return image_candidates[0] return None @@ -329,7 +336,7 @@ class Discorss: logging.basicConfig( filename=self.log_file_path, encoding="utf-8", - level=logging.WARNING, + level=logging.ERROR, datefmt="%m/%d/%Y %H:%M:%S", format="%(asctime)s [%(threadName)s] -> %(levelname)s: %(message)s", )