From: Sungmin Kwak Date: Fri, 15 May 2015 06:56:48 +0000 (+0900) Subject: Add error logs. X-Git-Tag: submit/tizen/20150612.011258~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e878032f4114311c3574cbde949f828b7f28763;p=platform%2Fcore%2Fapi%2Finputmethod-manager.git Add error logs. Change-Id: I896e3798c15d7d020f6a140863034cda92be2067 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a9921c..2067099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ SET(maintainer "Sungmin Kwak ") SET(description "Input Method Manager APIs") SET(service "ui") SET(submodule "inputmethod-manager") -SET(dependents "capi-base-common isf") +SET(dependents "capi-base-common dlog isf") SET(Services "application" diff --git a/packaging/capi-ui-inputmethod-manager.spec b/packaging/capi-ui-inputmethod-manager.spec index 81dbef0..640e8f6 100644 --- a/packaging/capi-ui-inputmethod-manager.spec +++ b/packaging/capi-ui-inputmethod-manager.spec @@ -7,6 +7,7 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(isf) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig diff --git a/src/inputmethod_manager.cpp b/src/inputmethod_manager.cpp index 3d91fe0..4e4e801 100644 --- a/src/inputmethod_manager.cpp +++ b/src/inputmethod_manager.cpp @@ -17,15 +17,23 @@ #include #include #include "isf_control.h" +#include #include +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "INPUTMETHOD_MANAGER" + int ime_manager_show_ime_list(void) { int ret = isf_control_show_ime_list(); if (ret == 0) return IME_MANAGER_ERROR_NONE; - else + else { + LOGW("IME_MANAGER_ERROR_OPERATION_FAILED"); return IME_MANAGER_ERROR_OPERATION_FAILED; + } } int ime_manager_show_ime_selector(void) @@ -33,30 +41,40 @@ int ime_manager_show_ime_selector(void) int ret = isf_control_show_ime_selector(); if (ret == 0) return IME_MANAGER_ERROR_NONE; - else + else { + LOGW("IME_MANAGER_ERROR_OPERATION_FAILED"); return IME_MANAGER_ERROR_OPERATION_FAILED; + } } int ime_manager_is_ime_enabled(const char *app_id, bool *enabled) { - if (!app_id || !enabled) + if (!app_id || !enabled) { + LOGW("IME_MANAGER_ERROR_INVALID_PARAMETER"); return IME_MANAGER_ERROR_INVALID_PARAMETER; + } int ret = isf_control_is_ime_enabled(app_id, enabled); - if (ret < 0) + if (ret < 0) { + LOGW("IME_MANAGER_ERROR_OPERATION_FAILED"); return IME_MANAGER_ERROR_OPERATION_FAILED; + } return IME_MANAGER_ERROR_NONE; } int ime_manager_get_active_ime(char **app_id) { - if (!app_id) + if (!app_id) { + LOGW("IME_MANAGER_ERROR_INVALID_PARAMETER"); return IME_MANAGER_ERROR_INVALID_PARAMETER; + } int ret = isf_control_get_active_ime(app_id); - if (ret < 0) + if (ret < 0) { + LOGW("IME_MANAGER_ERROR_OPERATION_FAILED"); return IME_MANAGER_ERROR_OPERATION_FAILED; + } return IME_MANAGER_ERROR_NONE; }