libevdev
1.4.4
A wrapper library for evdev devices
|
libevdev provides two methods of logging library-internal messages. More...
Typedefs | |
typedef void(* | libevdev_log_func_t) (enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) |
Logging function called by library-internal logging. More... | |
typedef void(* | libevdev_device_log_func_t) (const struct libevdev *dev, enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) |
Logging function called by library-internal logging for a specific libevdev context. More... | |
Enumerations | |
enum | libevdev_log_priority { LIBEVDEV_LOG_ERROR, LIBEVDEV_LOG_INFO, LIBEVDEV_LOG_DEBUG } |
Functions | |
void | libevdev_set_log_function (libevdev_log_func_t logfunc, void *data) |
Set a printf-style logging handler for library-internal logging. More... | |
void | libevdev_set_log_priority (enum libevdev_log_priority priority) |
Define the minimum level to be printed to the log handler. More... | |
enum libevdev_log_priority | libevdev_get_log_priority (void) |
Return the current log priority level. More... | |
void | libevdev_set_device_log_function (struct libevdev *dev, libevdev_device_log_func_t logfunc, enum libevdev_log_priority priority, void *data) |
Set a printf-style logging handler for library-internal logging for this device context. More... | |
libevdev provides two methods of logging library-internal messages.
The old method is to provide a global log handler in libevdev_set_log_function(). The new method is to provide a per-context log handler in libevdev_set_device_log_function(). Developers are encouraged to use the per-context logging facilities over the global log handler as it provides access to the libevdev instance that caused a message, and is more flexible when libevdev is used from within a shared library.
If a caller sets both the global log handler and a per-context log handler, each device with a per-context log handler will only invoke that log handler.
typedef void(* libevdev_device_log_func_t) (const struct libevdev *dev, enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) |
Logging function called by library-internal logging for a specific libevdev context.
This function is expected to treat its input like printf would.
dev | The evdev device |
priority | Log priority of this message |
data | User-supplied data pointer (see libevdev_set_log_function()) |
file | libevdev source code file generating this message |
line | libevdev source code line generating this message |
func | libevdev source code function generating this message |
format | printf-style format string |
args | List of arguments |
typedef void(* libevdev_log_func_t) (enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) |
Logging function called by library-internal logging.
This function is expected to treat its input like printf would.
priority | Log priority of this message |
data | User-supplied data pointer (see libevdev_set_log_function()) |
file | libevdev source code file generating this message |
line | libevdev source code line generating this message |
func | libevdev source code function generating this message |
format | printf-style format string |
args | List of arguments |
enum libevdev_log_priority libevdev_get_log_priority | ( | void | ) |
Return the current log priority level.
Messages higher than this level are printed, others are discarded. This is a global setting.
void libevdev_set_device_log_function | ( | struct libevdev * | dev, |
libevdev_device_log_func_t | logfunc, | ||
enum libevdev_log_priority | priority, | ||
void * | data | ||
) |
Set a printf-style logging handler for library-internal logging for this device context.
The default logging function is NULL, i.e. the global log handler is invoked. If a context-specific log handler is set, the global log handler is not invoked for this device.
dev | The evdev device |
logfunc | The logging function for this device. If NULL, the current logging function is unset and logging falls back to the global log handler, if any. |
priority | Minimum priority to be printed to the log. |
data | User-specific data passed to the log handler. |
void libevdev_set_log_function | ( | libevdev_log_func_t | logfunc, |
void * | data | ||
) |
Set a printf-style logging handler for library-internal logging.
The default logging function is to stdout.
logfunc | The logging function for this device. If NULL, the current logging function is unset and no logging is performed. |
data | User-specific data passed to the log handler. |
void libevdev_set_log_priority | ( | enum libevdev_log_priority | priority | ) |
Define the minimum level to be printed to the log handler.
Messages higher than this level are printed, others are discarded. This is a global setting and applies to any future logging messages.
priority | Minimum priority to be printed to the log. |