[PATCH libevdev 3/3] Add per-device log handlers

David Herrmann dh.herrmann at gmail.com
Mon May 26 01:04:28 PDT 2014


Hi

>> >> > diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
>> >> > index a316831..1e472a5 100644
>> >> > --- a/libevdev/libevdev.c
>> >> > +++ b/libevdev/libevdev.c
>> >> > @@ -36,6 +36,12 @@
>> >> >
>> >> >  #define MAXEVENTS 64
>> >> >
>> >> > +struct logdata {
>> >> > +       enum libevdev_log_priority priority;    /** minimum logging priority */
>> >> > +       libevdev_log_func_t handler;            /** handler function */
>> >> > +       void *userdata;                         /** user-defined data pointer */
>> >> > +};
>> >>
>> >> Ehhh, what? You keep that structure for the global log-data, but use a
>> >> separate one for "struct libevdev"? Why don't you use the same for
>> >> both?
>> >
>> > the log function signatures differ between normal and per-device logging,
>> > hence the two different structs. I'll send out a patch to re-use the struct
>> > but I don't see much benefit in passing the logdata vs the device.
>>
>> I mentioned one significant advantage: We can make libevdev_uinput
>> objects use the same logging infrastructure if needed.
>
> we'll burn that bridge when we cross it :)

Fair enough!

v2 is:
Reviewed-by: David Herrmann <dh.herrmann at gmail.com>

Thanks
David


More information about the Input-tools mailing list