e_input: print libinput logs in 'e_input' domain 78/296378/1
authorduna.oh <duna.oh@samsung.com>
Tue, 25 Jul 2023 09:06:22 +0000 (18:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 26 Jul 2023 09:20:21 +0000 (18:20 +0900)
set log levels using winfo
ex) winfo -eina_log_levels e_input:5 --> Debug level
    winfo -eina_log_levels e_input:1 --> Error level

Change-Id: I9bf1dcef79515bf887a773b7bdf3cd3409af7935

src/bin/e_input.c
src/bin/e_input_device.c
src/bin/e_input_private.h

index 89178eb..74e01e2 100644 (file)
@@ -137,6 +137,7 @@ e_input_init(Ecore_Evas *ee)
         EINA_LOG_ERR("Could not create logging domain for E_Input");
         goto log_err;
      }
+   eina_log_domain_level_set("e_input", EINA_LOG_LEVEL_INFO);
 
    E_INPUT_EVENT_SEAT_ADD = ecore_event_type_new();
    E_EVENT_INPUT_ENABLED = ecore_event_type_new();
index f788950..3e813e2 100644 (file)
@@ -683,7 +683,7 @@ e_input_device_touch_transformation_set(E_Input_Device *dev, int offset_x, int o
 }
 
 static void
-e_input_device_libinput_log_handler(struct libinput *libinput EINA_UNUSED,
+_libinput_log_handler(struct libinput *libinput EINA_UNUSED,
                                enum libinput_log_priority priority,
                                const char *format, va_list args)
 {
@@ -693,13 +693,13 @@ e_input_device_libinput_log_handler(struct libinput *libinput EINA_UNUSED,
    switch (priority)
      {
         case LIBINPUT_LOG_PRIORITY_DEBUG:
-           DBG("%s", buf);
+           EIDBG("%s", buf);
            break;
         case LIBINPUT_LOG_PRIORITY_INFO:
-           INF("%s", buf);
+           EIINF("%s", buf);
            break;
         case LIBINPUT_LOG_PRIORITY_ERROR:
-           ERR("%s", buf);
+           EIERR("%s", buf);
            break;
         default:
            break;
@@ -763,7 +763,7 @@ _einput_device_input_thread_udev_backend_heavy(void *data, Ecore_Thread *th, voi
    else
      {
         if (input->log_use_eina)
-          libinput_log_set_handler(input->libinput, e_input_device_libinput_log_handler);
+          libinput_log_set_handler(input->libinput, _libinput_log_handler);
         libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
      }
 
@@ -916,7 +916,7 @@ e_input_device_input_create_libinput_udev(E_Input_Device *dev)
    else
      {
         if (input->log_use_eina)
-          libinput_log_set_handler(input->libinput, e_input_device_libinput_log_handler);
+          libinput_log_set_handler(input->libinput, _libinput_log_handler);
         libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
      }
 
@@ -981,7 +981,7 @@ _einput_device_input_thread_path_backend_heavy(void *data, Ecore_Thread *th, voi
    else
      {
         if (input->log_use_eina)
-          libinput_log_set_handler(input->libinput, e_input_device_libinput_log_handler);
+          libinput_log_set_handler(input->libinput, _libinput_log_handler);
         libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
      }
 
@@ -1139,7 +1139,7 @@ e_input_device_input_create_libinput_path(E_Input_Device *dev)
    else
      {
         if (input->log_use_eina)
-          libinput_log_set_handler(input->libinput, e_input_device_libinput_log_handler);
+          libinput_log_set_handler(input->libinput, _libinput_log_handler);
         libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
      }
 
index 3cc357c..41cae45 100644 (file)
 #include <Eeze.h>
 #include <glib.h>
 
+#ifdef DBG
+# undef DBG
+#endif
+
+#ifdef INF
+# undef INF
+#endif
+
+#ifdef ERR
+# undef ERR
+#endif
+
+extern int _e_input_log_dom;
+#define DBG(...)  EINA_LOG_DOM_DBG(_e_input_log_dom, __VA_ARGS__)
+#define INF(...)  EINA_LOG_DOM_INFO(_e_input_log_dom, __VA_ARGS__)
+#define ERR(...)  EINA_LOG_DOM_ERR(_e_input_log_dom, __VA_ARGS__)
+
+#define EIERR(msg, ARG...) ERR("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+#define EIINF(msg, ARG...) INF("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+#define EIDBG(msg, ARG...) DBG("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+
 extern struct xkb_keymap *cached_keymap;
 extern struct xkb_context *cached_context;