From 5ac3489ee56f65f4137f1f62d6ea6b0b961ced5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Thu, 19 Oct 2023 20:04:26 -0700 Subject: [PATCH] Do not log website without icon as warning --- internal/reader/handler/handler.go | 2 +- internal/reader/icon/finder.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/reader/handler/handler.go b/internal/reader/handler/handler.go index 9ab454e3..4a87f92e 100644 --- a/internal/reader/handler/handler.go +++ b/internal/reader/handler/handler.go @@ -243,7 +243,7 @@ func checkFeedIcon(store *storage.Storage, feedID int64, websiteURL, feedIconURL if !store.HasIcon(feedID) { iconFinder := icon.NewIconFinder(websiteURL, feedIconURL, userAgent, fetchViaProxy, allowSelfSignedCertificates) if icon, err := iconFinder.FindIcon(); err != nil { - slog.Warn("Unable to find feed icon", + slog.Debug("Unable to find feed icon", slog.Int64("feed_id", feedID), slog.String("website_url", websiteURL), slog.String("feed_icon_url", feedIconURL), diff --git a/internal/reader/icon/finder.go b/internal/reader/icon/finder.go index 33e73b51..37a5e18d 100644 --- a/internal/reader/icon/finder.go +++ b/internal/reader/icon/finder.go @@ -189,16 +189,16 @@ func (f *IconFinder) DownloadIcon(iconURL string) (*model.Icon, error) { response, err := clt.Get() if err != nil { - return nil, fmt.Errorf("icon: unable to download iconURL: %v", err) + return nil, fmt.Errorf("icon: unable to download icon %s: %v", iconURL, err) } if response.HasServerFailure() { - return nil, fmt.Errorf("icon: unable to download icon: status=%d", response.StatusCode) + return nil, fmt.Errorf("icon: unable to download icon %s: status=%d", iconURL, response.StatusCode) } body, err := io.ReadAll(response.Body) if err != nil { - return nil, fmt.Errorf("icon: unable to read downloaded icon: %v", err) + return nil, fmt.Errorf("icon: unable to read downloaded icon from %s: %v", iconURL, err) } if len(body) == 0 {