Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "libinput-util.h"
#include "libinput-private.h"
+static FILE *g_log_file = NULL;
+
+void
+set_logging_enabled(int enabled)
+{
+ g_log_file = enabled ? stdout : NULL;
+}
+
+void
+log_info(const char *format, ...)
+{
+ va_list ap;
+
+ if (g_log_file) {
+ va_start(ap, format);
+ vfprintf(g_log_file, format, ap);
+ va_end(ap);
+ }
+}
+
void
list_init(struct list *list)
{
#ifndef LIBINPUT_UTIL_H
#define LIBINPUT_UTIL_H
+#include "libinput.h"
+
+void
+set_logging_enabled(int enabled);
+
+void
+log_info(const char *format, ...);
+
/*
* This list data structure is a verbatim copy from wayland-util.h from the
* Wayland project; except that wl_ prefix has been removed.