[Rpm-maint] [rpm-software-management/rpm] Add rpmLogOnce to filter log message (Issue #3395)

Panu Matilainen notifications at github.com
Tue Oct 29 10:46:09 UTC 2024


Hmm, so you could of course easily count the times you get called per each key, and then optionally emit a "repeated X times" when on reset so you'd basically get the #3336 behavior and the more regular log suppression style from the same thing.

The lifetime could be handled by throwing in a context or id to the mix, this could be an arbitrary 64bit int so you can pass in a pointer (ts, spec, whatever), have the keys hang off that, and then have a function to reset the context.

So that'd become something like this, with id 0 (zero) being a global aka per-process lifetime context always, the rest are up to the caller:

void rpmlogOnce (uint64_t id, const char * key, int code, const char *fmt, ...);
void rpmlogReset(uint64_t id, int suppress);

One thing here is that I'd much rather add an internal-only API for this first, that lets us experiment and fiddle with it until we're happy and then make it public if/when the time comes.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3395#issuecomment-2443867384
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/3395/2443867384 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241029/528e3e90/attachment.html>


More information about the Rpm-maint mailing list