Skip to content

logging: add "only_once=False" param to logger.info/warning/etc calls #10015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SomberNight
Copy link
Member

adds very basic form of opt-in rate-limiting of log spam

related #10011 (comment)

very basic form of opt-in rate-limiting of log spam
@ecdsa
Copy link
Member

ecdsa commented Jul 10, 2025

instead of overloading the Logger class, it is possible to use addFilter/removeFilter
see https://stackoverflow.com/questions/31953272/logging-print-message-only-once

@SomberNight
Copy link
Member Author

I saw Logger.addFilter but I wanted an API that allows opting-into this behaviour on a per-logline-call level.
addFilter is not a good fit for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants