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.
Author: Bastien Nocera <email@example.com>
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.