e_input_backend: make e_input_backend_log_level_set 88/314288/3
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 9 Jul 2024 02:17:42 +0000 (11:17 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 10 Jul 2024 04:30:10 +0000 (04:30 +0000)
and then use it.

Change-Id: Ia26b11331dd2da4529f85cf05c13372f8ebe255a

src/bin/debug/e_info_server.c
src/bin/inputmgr/e_input_backend.c
src/bin/inputmgr/e_input_backend_intern.h
src/bin/inputmgr/e_input_device.c
src/bin/inputmgr/e_input_device_intern.h

index eb875dab59b11dd7d5a17c8de0ffa3f501553fc7..a2cc36e25658728fa26fd8ac8038d1eb64e7974f 100644 (file)
@@ -3173,12 +3173,7 @@ _e_info_server_cb_eina_log_levels(const Eldbus_Service_Interface *iface EINA_UNU
         eina_log_domain_level_set((const char*)module_name, level);
 
         if (!e_util_strcmp(module_name, "e_input"))
-          {
-             if (!e_input_device_libinput_log_level_set(NULL, level))
-               ERR("an attempt to set libinput log level(%d) failed", level);
-             else
-               INF("Setting libinput log level(%d) succeeded", level);
-          }
+          e_input_device_libinput_log_level_set(NULL, level);
 
 parse_end:
         start = strchr(tmp, ',');
index dbe6e47761293aa5c9add94afc4b4376d3fb4244..7d71079ad5c5273d5ee34ce7b27d79fe0c5c4a45 100644 (file)
@@ -1784,3 +1784,36 @@ e_input_backend_libinput_context_create(E_Input_Backend *input)
 
    return EINA_TRUE;
 }
+
+EINTERN void
+e_input_backend_log_level_set(E_Input_Backend *input, unsigned int level)
+{
+   EINA_SAFETY_ON_NULL_RETURN(input);
+
+   if (input->log_disable)
+     {
+         ERR("Failed to set libinput log priority(%d) (input->log_disable:True)", level);
+         return;
+     }
+
+   if (!input->log_use_eina)
+     {
+        ERR("Failed to set libinput log priority(%d) (input->log_use_eina:False)", level);
+        return;
+     }
+
+   switch (level)
+     {
+        case 1:
+          libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_ERROR);
+          break;
+        case 3:
+          libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
+          break;
+        case 5:
+          libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_DEBUG);
+          break;
+        default:
+          break;
+     }
+}
index 3181c664e1d88146c7b5bd89d35855667351ecff..a5965a48d5b0c81a1bf72388b1370b343b866f95 100644 (file)
@@ -48,5 +48,6 @@ EINTERN void      e_input_backend_key_event_list_add(Ecore_Event_Key *key);
 EINTERN E_Input_Backend *e_input_backend_create_libinput_udev(void);
 EINTERN E_Input_Backend *e_input_backend_create_libinput_path(int ndevices);
 EINTERN Eina_Bool        e_input_backend_libinput_context_create(E_Input_Backend *input);
+EINTERN void             e_input_backend_log_level_set(E_Input_Backend *input, unsigned int level);
 
 #endif
index c5652af8b1a150f46625e14469d9a5f72a380173..21346c3673b5588177895e7caad1ee036ee14ecc 100644 (file)
@@ -1240,46 +1240,19 @@ e_input_device_is_virtual(E_Input_Device *dev, const char *device_path, Ecore_De
   return ret;
 }
 
-EINTERN Eina_Bool
+EINTERN void
 e_input_device_libinput_log_level_set(E_Input_Device *dev, unsigned int level)
 {
    Eina_List *l;
    E_Input_Backend* input;
-   Eina_Bool ret = EINA_TRUE;
 
    if (!dev)
      dev = _e_input_device_default_get();
 
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(!dev, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN(dev);
+
    EINA_LIST_FOREACH(dev->inputs, l, input)
      {
-        if (input->log_disable)
-          {
-             ERR("Failed to set libinput log priority(%d) (input->log_disable:True)", level);
-             ret = EINA_FALSE;
-             continue;
-          }
-        if (!input->log_use_eina)
-          {
-             ERR("Failed to set libinput log priority(%d) (input->log_use_eina:False)", level);
-             ret = EINA_FALSE;
-             continue;
-          }
-        switch (level)
-          {
-             case 1:
-                libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_ERROR);
-                break;
-             case 3:
-                libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
-                break;
-             case 5:
-                libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_DEBUG);
-                break;
-             default:
-                break;
-          }
+        e_input_backend_log_level_set(input, level);
      }
-
-   return ret;
 }
index 35f955f004551883eb1aa431900476f8d4791ff9..92bf4a5609ee1ae6d6c502a4c8ec39515457f28e 100644 (file)
@@ -39,7 +39,7 @@ EINTERN void            e_input_device_keyboard_cached_keymap_set(struct xkb_key
 EINTERN Eina_Bool       e_input_device_keyboard_remap_set(E_Input_Device *dev, int *from_keys, int *to_keys, int num);
 
 EINTERN Eina_Bool       e_input_device_input_backend_create(E_Input_Device *dev, E_Input_Libinput_Backend backend);
-EINTERN Eina_Bool       e_input_device_libinput_log_level_set(E_Input_Device *dev, unsigned int level);
+EINTERN void            e_input_device_libinput_log_level_set(E_Input_Device *dev, unsigned int level);
 
 EINTERN void            e_input_device_pointer_xy_get(E_Input_Device *dev, int *x, int *y);
 EINTERN Eina_Bool       e_input_device_pointer_left_handed_set(E_Input_Device *dev, Eina_Bool left_handed);