custom-components / feedparser

📰 RSS Feed Integration
MIT License
135 stars 34 forks source link

0.2.0b6 / Logger warnings about more than 1 link #123

Closed pxFIN closed 6 months ago

pxFIN commented 6 months ago

In my case i rebooted host 2 hours ago and

Logger: custom_components.feedparser.sensor Source: custom_components/feedparser/sensor.py:268 Integration: feedparser (documentation, issues) First occurred: 14:06:15 (5668 occurrences) Last logged: 16:19:17

Warnings are about more than one link so basically this:

    def _process_link(self: FeedParserSensor, feed_entry: FeedParserDict) -> str:
        """Return link from feed entry."""
        if "links" in feed_entry:
            if len(feed_entry["links"]) > 1:
                _LOGGER.warning(
                    "Feed %s: More than one link found for %s. Using the first link.",
                    self.name,
                    feed_entry,
                )
            return feed_entry["links"][0]["href"]
        return ""

Which is OK relevant for some feeds but 'accidentally' noticed on one HA host when trying to download diagnostics logs it was 438 megabytes of which major part is feedparser/warning

Just wondering if _LOGGER.warning is the best choice ?

ogajduse commented 6 months ago

Thank you for pointing that out. I will change warning level to debug so people do not end up with bulky logs. If not today, I should do a release in a few days.

ogajduse commented 6 months ago

Commited as ec3a56b in #124 Released in https://github.com/custom-components/feedparser/releases/tag/0.2.0b7