From c9e894034bbceada59fbcd557d6f5f4740012c67 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Wed, 11 Oct 2023 16:37:35 +0200 Subject: [PATCH] Log more useful things when checking a logo Signed-off-by: Benjamin Brahmer --- lib/Fetcher/FeedFetcher.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index 001a50bb4..b079f63a9 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -427,10 +427,10 @@ protected function getFavicon(FeedInterface $feed, string $url): ?string $downloaded = true; $this->logger->debug( - "Feed:{url} Logo:{logo} Status:{status}", + "Feed:{feed} Logo:{logo} Status:{status}", [ 'status' => $response->getStatusCode(), - 'url' => $favicon_path, + 'feed' => $url, 'logo' => $favicon ] ); @@ -448,6 +448,14 @@ protected function getFavicon(FeedInterface $feed, string $url): ?string // check if file is actually an image if (!$is_image) { + $this->logger->debug( + "Downloaded file:{file} from {url} is not an image", + [ + 'file' => $favicon_path, + 'url' => $favicon + ] + ); + $return = $this->faviconFactory->get($base_url); return is_string($return) ? $return : null; } @@ -455,6 +463,13 @@ protected function getFavicon(FeedInterface $feed, string $url): ?string list($width, $height, $type, $attr) = getimagesize($favicon_path); // check if image is square else fall back to favicon if ($width !== $height) { + $this->logger->debug( + "Downloaded file:{file} from {url} is not square", + [ + 'file' => $favicon_path, + 'url' => $favicon + ] + ); $return = $this->faviconFactory->get($base_url); return is_string($return) ? $return : null; }