python-caldav / caldav

Apache License 2.0
333 stars 98 forks source link

Make some way to mute or rate-limit verbose error logging #266

Open tobixen opened 1 year ago

tobixen commented 1 year ago

Ref https://github.com/home-assistant/core/issues/86938

tobixen commented 1 year ago

I did throw in some rate-limiting, but the homeassistant people were apparently not happy and wanted the error muted completely. I'm not quite sure what to do here. I feel that the library ought to be noisy by default since modifying the icalendar data is kind of an unexpected side effect (but still necessarily to avoid compatibility problems), but at the same time it should be possible to mute those alarms through some kind of configuration?

MelissaAutumn commented 2 weeks ago

Hello!

We ran into this notice on Thunderbird Appointment (as we use python-caldav.)

I would suggest using a different logger for this message so the user can mute separately using logging.getLogger('caldav-malformed-events') (as an example.)

Alternatively I'd suggest changing the log level of this message to a warning, as the application will still proceed but it's still signficiant enough to alert the consuming application about.

I'm happy to submit a patch either way!

tobixen commented 2 weeks ago

It has already been downgraded to a warning in the last release. A different logger could also make sense. A pull request is good.

MelissaAutumn commented 2 weeks ago

Oh that's what happens when I don't check if my packages are out of date before commenting 😅. Thanks for the info!

I think warning is the approriate move here, but I can push up a separate logger for that message sometime this week if that still works.