Add error logs. 41/40941/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Fri, 15 May 2015 06:52:48 +0000 (15:52 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 10 Jun 2015 09:12:39 +0000 (18:12 +0900)
Change-Id: Ie6243b9f381c2e47e80456f412be5b00075ac272

src/inputmethod.cpp

index 6919b79..346300c 100644 (file)
@@ -376,11 +376,15 @@ int ime_run(ime_callback_s *basic_cb, void *user_data)
 
 int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.focus_in = callback_func;
     g_event_callback.focus_in_user_data = user_data;
@@ -390,11 +394,15 @@ int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data)
 
 int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.focus_out = callback_func;
     g_event_callback.focus_out_user_data = user_data;
@@ -404,11 +412,15 @@ int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data)
 
 int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.surrounding_text_updated = callback_func;
     g_event_callback.surrounding_text_updated_user_data = user_data;
@@ -418,11 +430,15 @@ int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb ca
 
 int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.input_context_reset = callback_func;
     g_event_callback.input_context_reset_user_data = user_data;
@@ -432,11 +448,15 @@ int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_fun
 
 int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.cursor_position_updated = callback_func;
     g_event_callback.cursor_position_updated_user_data = user_data;
@@ -446,11 +466,15 @@ int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb call
 
 int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.language_requested = callback_func;
     g_event_callback.language_requested_user_data = user_data;
@@ -460,11 +484,15 @@ int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func,
 
 int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.language_set = callback_func;
     g_event_callback.language_set_user_data = user_data;
@@ -474,11 +502,15 @@ int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_
 
 int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.imdata_set = callback_func;
     g_event_callback.imdata_set_user_data = user_data;
@@ -488,11 +520,15 @@ int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data
 
 int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.imdata_requested = callback_func;
     g_event_callback.imdata_requested_user_data = user_data;
@@ -502,11 +538,15 @@ int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, voi
 
 int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.layout_set = callback_func;
     g_event_callback.layout_set_user_data = user_data;
@@ -516,11 +556,15 @@ int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data
 
 int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.return_key_type_set = callback_func;
     g_event_callback.return_key_type_set_user_data = user_data;
@@ -530,11 +574,15 @@ int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_fun
 
 int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.return_key_state_set = callback_func;
     g_event_callback.return_key_state_set_user_data = user_data;
@@ -544,11 +592,15 @@ int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_f
 
 int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.geometry_requested = callback_func;
     g_event_callback.geometry_requested_user_data = user_data;
@@ -558,11 +610,15 @@ int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func,
 
 int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.process_key_event = callback_func;
     g_event_callback.process_key_event_user_data = user_data;
@@ -572,11 +628,15 @@ int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, v
 
 int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.display_language_changed = callback_func;
     g_event_callback.display_language_changed_user_data = user_data;
@@ -586,11 +646,15 @@ int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb ca
 
 int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.rotation_degree_changed = callback_func;
     g_event_callback.rotation_degree_changed_user_data = user_data;
@@ -600,11 +664,15 @@ int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb call
 
 int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.accessibility_state_changed = callback_func;
     g_event_callback.accessibility_state_changed_user_data = user_data;
@@ -614,11 +682,15 @@ int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed
 
 int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.option_window_created = callback_func;
     g_event_callback.option_window_created_user_data = user_data;
@@ -628,11 +700,15 @@ int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback
 
 int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb callback_func, void *user_data)
 {
-    if (!callback_func)
+    if (!callback_func) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
-    if (g_running)
+    if (g_running) {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 
     g_event_callback.option_window_destroyed = callback_func;
     g_event_callback.option_window_destroyed_user_data = user_data;
@@ -642,8 +718,10 @@ int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb call
 
 int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
     if (forward_key)
         g_core.forward_key_event(-1, NULL, (sclu32)keycode, (sclu16)keymask);
@@ -655,11 +733,15 @@ int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forw
 
 int ime_commit_string(const char *str)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!str)
+    if (!str) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     g_core.commit_string(-1, NULL, str);
 
@@ -668,8 +750,10 @@ int ime_commit_string(const char *str)
 
 int ime_show_preedit_string(void)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
     g_core.show_preedit_string(-1, NULL);
 
@@ -678,8 +762,10 @@ int ime_show_preedit_string(void)
 
 int ime_hide_preedit_string(void)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
     g_core.hide_preedit_string(-1, NULL);
 
@@ -688,11 +774,15 @@ int ime_hide_preedit_string(void)
 
 int ime_update_preedit_string(const char *str, Eina_List *attrs)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!str)
+    if (!str) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     scim::AttributeList attrv;
     ime_preedit_attribute *attr = NULL;
@@ -713,11 +803,15 @@ int ime_update_preedit_string(const char *str, Eina_List *attrs)
 
 int ime_request_surrounding_text(int maxlen_before, int maxlen_after)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!g_event_callback.surrounding_text_updated)
+    if (!g_event_callback.surrounding_text_updated) {
+        LOGW("IME_ERROR_NO_CALLBACK_FUNCTION");
         return IME_ERROR_NO_CALLBACK_FUNCTION;
+    }
 
     g_core.get_surrounding_text(NULL, maxlen_before, maxlen_after);
 
@@ -726,11 +820,15 @@ int ime_request_surrounding_text(int maxlen_before, int maxlen_after)
 
 int ime_delete_surrounding_text(int offset, int len)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (len <= 0)
+    if (len <= 0) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     g_core.delete_surrounding_text(offset, len);
 
@@ -743,6 +841,7 @@ Evas_Object* ime_get_main_window(void)
 
     if (!g_running) {
         set_last_result(IME_ERROR_NOT_RUNNING);
+        LOGW("IME_ERROR_NOT_RUNNING");
         return NULL;
     }
 
@@ -752,6 +851,7 @@ Evas_Object* ime_get_main_window(void)
     }
     else {
         set_last_result(IME_ERROR_OPERATION_FAILED);
+        LOGW("IME_ERROR_OPERATION_FAILED");
     }
 
     return win;
@@ -761,8 +861,10 @@ int ime_set_size(int portrait_width, int portrait_height, int landscape_width, i
 {
     SclSize portrait_size, landscape_size;
 
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
     portrait_size.width = portrait_width;
     portrait_size.height = portrait_height;
@@ -777,8 +879,10 @@ int ime_set_size(int portrait_width, int portrait_height, int landscape_width, i
 
 int ime_create_option_window(void)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
     if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) {
         LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set.");
@@ -787,14 +891,18 @@ int ime_create_option_window(void)
 
     if (g_core.create_option_window())
         return IME_ERROR_NONE;
-    else
+    else {
+        LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
+    }
 }
 
 int ime_destroy_option_window(Evas_Object *window)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
     if (!window) {
         LOGW("Window pointer is null.");
@@ -813,11 +921,15 @@ int ime_destroy_option_window(Evas_Object *window)
 
 int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !layout)
+    if (!context || !layout) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *layout = context->layout;
 
@@ -826,11 +938,15 @@ int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *
 
 int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !layout_variation)
+    if (!context || !layout_variation) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *layout_variation = static_cast<ime_layout_variation_e>(context->layout_variation);
 
@@ -839,11 +955,15 @@ int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation
 
 int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !cursor_pos)
+    if (!context || !cursor_pos) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *cursor_pos = context->cursor_pos;
 
@@ -852,11 +972,15 @@ int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos)
 
 int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !autocapital_type)
+    if (!context || !autocapital_type) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *autocapital_type = context->autocapital_type;
 
@@ -865,11 +989,15 @@ int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapita
 
 int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !return_key_type)
+    if (!context || !return_key_type) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *return_key_type = context->return_key_type;
 
@@ -878,11 +1006,15 @@ int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel
 
 int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !return_key_state)
+    if (!context || !return_key_state) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *return_key_state = static_cast<bool>(context->return_key_disabled);
 
@@ -891,11 +1023,15 @@ int ime_context_get_return_key_state(ime_context_h context, bool *return_key_sta
 
 int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !prediction_mode)
+    if (!context || !prediction_mode) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *prediction_mode = static_cast<bool>(context->prediction_allow);
 
@@ -904,11 +1040,15 @@ int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode
 
 int ime_context_get_password_mode(ime_context_h context, bool *password_mode)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !password_mode)
+    if (!context || !password_mode) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *password_mode = static_cast<bool>(context->password_mode);
 
@@ -917,11 +1057,15 @@ int ime_context_get_password_mode(ime_context_h context, bool *password_mode)
 
 int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !input_hint)
+    if (!context || !input_hint) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *input_hint = context->input_hint;
 
@@ -930,11 +1074,15 @@ int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *inp
 
 int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !bidi)
+    if (!context || !bidi) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *bidi = context->bidi_direction;
 
@@ -943,11 +1091,15 @@ int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Directi
 
 int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!context || !language)
+    if (!context || !language) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *language = context->language;
 
@@ -956,11 +1108,15 @@ int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *
 
 int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!dev_info || !dev_name)
+    if (!dev_info || !dev_name) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     if (!dev_info->dev_name)
         *dev_name = strdup("");
@@ -972,11 +1128,15 @@ int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name)
 
 int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!dev_info || !dev_class)
+    if (!dev_info || !dev_class) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *dev_class = dev_info->dev_class;
 
@@ -985,11 +1145,15 @@ int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class
 
 int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass)
 {
-    if (!g_running)
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
         return IME_ERROR_NOT_RUNNING;
+    }
 
-    if (!dev_info || !dev_subclass)
+    if (!dev_info || !dev_subclass) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
         return IME_ERROR_INVALID_PARAMETER;
+    }
 
     *dev_subclass = dev_info->dev_subclass;