On 14/02/12 06:38 +0000, Dietmar Maurer wrote:
> -----Original Message-----
> From: quarterback-devel-bounces(a)lists.fedorahosted.org [mailto:quarterback-
> devel-bounces(a)lists.fedorahosted.org] On Behalf Of Dietmar Maurer
> Sent: Dienstag, 14. Februar 2012 07:12
> To: lib quarterback
> Subject: Re: [libqb] howto filter libqb logs
>
> > In the short term filter by the file names in lib/*.c (not ideal I
> > know but it will get the job done).
First, it seems that I simply not fully understand the API, so forgive me
if this makes no sense to you.
But I would dump that whole qb_log_filter_ctl() API and simply allow
the user configure a filter callback function.
int32_t qb_log_filter_fn_set(int32_t target, qb_log_filter_fn fn);
IMHO that would we much simpler, because:
- no need to maintain a filter database (list of filters)
- no need to define an API to modify that database
- no need to define the semantics to apply those filters
- full control to the user (not restricted by the semantics of your filter API)
Or what is the advantage of qb_log_filter_ctl()?
Hi Dietmar
I am totally open to that, in fact I did have that at one
point but others wanted a "higher level api".
So to define the behavior:
qb_log_filter_fn_set(target, my_filter_fn);
This will immediatly call my_filter_fn with all currently
know callsites. It and call it later if there are new ones.
If there is a change to your logic in my_filter_fn then
just call qb_log_filter_fn_set() again.
How is that?
I can't drop the other functions now.
-Angus
- Dietmar
_______________________________________________
quarterback-devel mailing list
quarterback-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/quarterback-devel