fp_set_debug() should use an enum instead of magic numbers.
Or use GLib's log levels instead, as we already use GLib internally anyway.
Philip Withnall looked at this and mentioned that we should: "Just define them to the same values as the GLogLevel ones, since they’re never going to change" "You could add G_STATIC_ASSERT (FP_LOG_LEVEL_DEBUG == G_LOG_LEVEL_DEBUG) in your .c file to ensure the APIs don’t slide out of sync" fpi_log_level also looks to be the internal-only version of that enum.
I actually went a different way, as using the same log levels as GLib would have required API changes, and no application actually uses fp_set_debug() anyway, as the application would require special handling for its debug mode. I just nuked the internal logging code and made it use the GLib ones directly, and documented how to change the internal libfprint and libusb debug outputs. commit 32fcfde86b3d57305c29b545aa084d28c7c76fe9 Author: Bastien Nocera <hadess@hadess.net> Date: Wed May 23 17:48:55 2018 +0200 lib: Use GLib and libusb directly for debug output Use GLib internally to output debug information, and tell about libusb's LIBUSB_DEBUG envvar for libusb debug. fp_set_debug() is now a no-op. https://bugs.freedesktop.org/show_bug.cgi?id=106552
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.