Logging in libfprint is handled through GLib's logging system, and behave the same way as in the GLib Message Output and Debugging Functions documentation.
You should include
fpi-log.h as early as possible in your sources, just after
FP_COMPONENT define to a string unique to your sources. This will
set the suffix of the
G_LOG_DOMAIN used for printing.
fp_err() to print an error if the
#define BUG() BUG_ON (1)
BUG_ON() but is always true.