mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
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
This commit is contained in:
@@ -21,8 +21,13 @@
|
||||
#define __FPRINT_INTERNAL_H__
|
||||
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef FP_COMPONENT
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "libfprint-"FP_COMPONENT
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glib.h>
|
||||
#include <libusb.h>
|
||||
|
||||
@@ -34,26 +39,10 @@
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||
|
||||
enum fpi_log_level {
|
||||
FPRINT_LOG_LEVEL_DEBUG,
|
||||
FPRINT_LOG_LEVEL_INFO,
|
||||
FPRINT_LOG_LEVEL_WARNING,
|
||||
FPRINT_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(FPRINT_LOG_LEVEL_DEBUG, fmt)
|
||||
#define fp_info(fmt...) _fpi_log(FPRINT_LOG_LEVEL_INFO, fmt)
|
||||
#define fp_warn(fmt...) _fpi_log(FPRINT_LOG_LEVEL_WARNING, fmt)
|
||||
#define fp_err(fmt...) _fpi_log(FPRINT_LOG_LEVEL_ERROR, fmt)
|
||||
#define fp_dbg g_debug
|
||||
#define fp_info g_debug
|
||||
#define fp_warn g_warning
|
||||
#define fp_err g_error
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BUG_ON(condition) \
|
||||
|
||||
Reference in New Issue
Block a user