From: duna.oh Date: Tue, 25 Jul 2023 09:06:22 +0000 (+0900) Subject: e_input: print libinput logs in 'e_input' domain X-Git-Tag: accepted/tizen/unified/20230727.055142~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c988c6a2af03c730729b31e2db6aaa3cb984344;p=platform%2Fupstream%2Fenlightenment.git e_input: print libinput logs in 'e_input' domain 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 --- diff --git a/src/bin/e_input.c b/src/bin/e_input.c index 89178eb..74e01e2 100644 --- a/src/bin/e_input.c +++ b/src/bin/e_input.c @@ -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(); diff --git a/src/bin/e_input_device.c b/src/bin/e_input_device.c index f788950..3e813e2 100644 --- a/src/bin/e_input_device.c +++ b/src/bin/e_input_device.c @@ -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); } diff --git a/src/bin/e_input_private.h b/src/bin/e_input_private.h index 3cc357c..41cae45 100644 --- a/src/bin/e_input_private.h +++ b/src/bin/e_input_private.h @@ -13,6 +13,27 @@ #include #include +#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;