mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Add logging infrastructure
Also added some debug/error messages to existing code. For now debugging is always on, this will be made optional later.
This commit is contained in:
committed by
Daniel Drake
parent
016ff33533
commit
ec91736ac4
@@ -28,6 +28,27 @@
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
|
||||
|
||||
enum fpi_log_level {
|
||||
LOG_LEVEL_DEBUG,
|
||||
LOG_LEVEL_INFO,
|
||||
LOG_LEVEL_WARNING,
|
||||
LOG_LEVEL_ERROR,
|
||||
};
|
||||
|
||||
void fpi_log(enum fpi_log_level, const char *component, const char *function,
|
||||
const char *format, ...);
|
||||
|
||||
#ifndef FP_COMPONENT
|
||||
#define FP_COMPONENT NULL
|
||||
#endif
|
||||
|
||||
#define _fpi_log(level, fmt...) fpi_log(level, FP_COMPONENT, __FUNCTION__, fmt)
|
||||
|
||||
#define fp_dbg(fmt...) _fpi_log(LOG_LEVEL_DEBUG, fmt)
|
||||
#define fp_info(fmt...) _fpi_log(LOG_LEVEL_INFO, fmt)
|
||||
#define fp_warn(fmt...) _fpi_log(LOG_LEVEL_WARNING, fmt)
|
||||
#define fp_err(fmt...) _fpi_log(LOG_LEVEL_ERROR, fmt)
|
||||
|
||||
struct fp_dev {
|
||||
const struct fp_driver *drv;
|
||||
usb_dev_handle *udev;
|
||||
|
||||
Reference in New Issue
Block a user