weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
84 stars 19 forks source link

User-supplied log handler #28

Closed charlesnicholson closed 5 months ago

charlesnicholson commented 5 months ago

It would be very nice if the bluez_inc log handler took a user-supplied logging callback. In our setup we already have a full logging + diagnostics system, and I want to just plug bluez_inc logs into that.

If bluez_inc had something like:

typedef void (*log_cb)(LogLevel level, char const *tag, char const *msg);
void log_set_cb(log_cb cb);

Then bluez_inc could use its own logger by default, but if I provide my own all bluez_inc logs would only go through my callback.

(If you're interested, I could try a PR)

weliem commented 5 months ago

Yes, good idea, feel free to raise a PR!

weliem commented 5 months ago

Thx for the PR!