Allow libddcutil users to provide custom logging facilities instead of syslog
It appears that libddcutil will always log to syslog (unless logging is disabled entirely). In order to be able to keep log output in one place for applications that use libddcutil, it would be beneficial if it were possible to provide a callback function pointer that libddcutil would invoke, passing log level, message (maybe as format string and args?) as well as a userdata pointer for an application to be able to handle logging.
Interesting enhancement request. Unfortunately, it's non-trivial. The logging and tracing facilities have accreted over the years, (see the output of ddcutil --hh | grep -E "log|trace"). Passing a format string with args would require rewriting all calls that ultimately result in a line in the system log, whatever the path.
I'm curious to know what your application is that uses libddcutil and would benefit from this enhancement.
You may describe the enhancment in the Discussions section. Perhaps it has wider utility than I imagine.
My application is quite trivial actually, it's just a small script I have in my dotfiles that will set the brightness of all monitors via both DDC and sysfs and decided to port it over to libddcutil in favor of the command to improve performance (which is quite noticable). The log output thing is just a minor nitpick here, but since many libraries offer this sort of API, I thought it might be worth mentioning. (code)