Change macro log name 17/97417/2 accepted/tizen/3.0/common/20161116.143604 accepted/tizen/3.0/ivi/20161116.022253 accepted/tizen/3.0/mobile/20161116.022041 accepted/tizen/3.0/tv/20161116.022137 accepted/tizen/3.0/wearable/20161116.022218 accepted/tizen/common/20161125.095423 accepted/tizen/ivi/20161125.004224 accepted/tizen/mobile/20161125.003752 accepted/tizen/tv/20161125.003941 accepted/tizen/wearable/20161125.004103 submit/tizen/20161124.000829 submit/tizen_3.0/20161115.024443
authorseungha.son <seungha.son@samsung.com>
Mon, 14 Nov 2016 06:29:40 +0000 (15:29 +0900)
committerseungha.son <seungha.son@samsung.com>
Tue, 15 Nov 2016 02:16:32 +0000 (11:16 +0900)
Signed-off-by: seungha.son <seungha.son@samsung.com>
Change-Id: I38476c8d6bb3a559a023c3068d8d80e012c85aa7

lib/include/shortcut_private.h
lib/src/shortcut_db.c
lib/src/shortcut_internal.c
lib/src/shortcut_manager.c

index b031c73..11ab0ce 100755 (executable)
  */
 
 #if !defined(FLOG)
-#define DbgPrint(format, arg...)       SECURE_LOGD(format, ##arg)
-#define ErrPrint(format, arg...)       SECURE_LOGE(format, ##arg)
+#define SHORTCUT_DBG(format, arg...)   SECURE_LOGD(format, ##arg)
+#define SHORTCUT_ERR(format, arg...)   SECURE_LOGE(format, ##arg)
+#define SHORTCUT_INFO(format, arg...)  SECURE_LOGI(format, ##arg)
 #else
 extern FILE *__file_log_fp;
-#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
-
-#define ErrPrint(format, arg...) do { fprintf(__file_log_fp, "[ERR] [\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+#define SHORTCUT_DBG(format, arg...) do { fprintf(__file_log_fp, "[D] [\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+#define SHORTCUT_ERR(format, arg...) do { fprintf(__file_log_fp, "[E] [\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+#define SHORTCUT_INFO(format, arg...) do { fprintf(__file_log_fp, "[I] [\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
 #endif
 
 #if !defined(EAPI)
index eb043f8..9dfd9f8 100755 (executable)
@@ -34,7 +34,7 @@ static sqlite3 *_open_db(void)
        ret = db_util_open(dbfile, &db, 0);
        if (ret != SQLITE_OK) {
                /* LCOV_EXCL_START */
-               DbgPrint("Failed to open a %s\n", dbfile);
+               SHORTCUT_DBG("Failed to open a %s\n", dbfile);
                return NULL;
                /* LCOV_EXCL_STOP */
        }
@@ -52,7 +52,7 @@ static int _close_db(sqlite3 **db)
        ret = db_util_close(*db);
        if (ret != SQLITE_OK) {
                /* LCOV_EXCL_START */
-               DbgPrint("DB close error(%d)", ret);
+               SHORTCUT_DBG("DB close error(%d)", ret);
                return SHORTCUT_ERROR_IO_ERROR;
                /* LCOV_EXCL_STOP */
        }
@@ -77,27 +77,27 @@ static inline int _get_i18n_name(sqlite3 *handle, const char *lang, int id, char
 
        status = sqlite3_prepare_v2(handle, query, -1, &stmt, NULL);
        if (status != SQLITE_OK) {
-               ErrPrint("Failed to prepare stmt: %s\n", sqlite3_errmsg(handle));
+               SHORTCUT_ERR("Failed to prepare stmt: %s\n", sqlite3_errmsg(handle));
                return -EFAULT;
        }
 
        status = sqlite3_bind_int(stmt, 1, id);
        if (status != SQLITE_OK) {
-               ErrPrint("Failed to bind id: %s\n", sqlite3_errmsg(handle));
+               SHORTCUT_ERR("Failed to bind id: %s\n", sqlite3_errmsg(handle));
                ret = -EFAULT;
                goto out;
        }
 
        status = sqlite3_bind_text(stmt, 2, lang, -1, SQLITE_TRANSIENT);
        if (status != SQLITE_OK) {
-               ErrPrint("Failed to bind lang: %s\n", sqlite3_errmsg(handle));
+               SHORTCUT_ERR("Failed to bind lang: %s\n", sqlite3_errmsg(handle));
                ret = -EFAULT;
                goto out;
        }
 
-       DbgPrint("id: %d, lang: %s\n", id, lang);
+       SHORTCUT_DBG("id: %d, lang: %s\n", id, lang);
        if (SQLITE_ROW != sqlite3_step(stmt)) {
-               ErrPrint("Failed to do step: %s\n", sqlite3_errmsg(handle));
+               SHORTCUT_ERR("Failed to do step: %s\n", sqlite3_errmsg(handle));
                ret = -ENOENT;
                goto out;
        }
@@ -107,7 +107,7 @@ static inline int _get_i18n_name(sqlite3 *handle, const char *lang, int id, char
                if (_name && strlen((const char *)_name)) {
                        *name = strdup((const char *)_name);
                        if (!*name) {
-                               ErrPrint("strdup: %d\n", errno);
+                               SHORTCUT_ERR("strdup: %d\n", errno);
                                ret = -ENOMEM;
                                goto out;
                        }
@@ -121,7 +121,7 @@ static inline int _get_i18n_name(sqlite3 *handle, const char *lang, int id, char
                if (_icon && strlen((const char *)_icon)) {
                        *icon = strdup((const char *)_icon);
                        if (!*icon) {
-                               ErrPrint("strdup: %d\n", errno);
+                               SHORTCUT_ERR("strdup: %d\n", errno);
                                ret = -ENOMEM;
                                if (name && *name)
                                        free(*name);
@@ -163,7 +163,7 @@ static inline char *_cur_locale(void)
        } else {
                language = strdup("en-us");
                if (!language)
-                       ErrPrint("Heap: %d\n", errno);
+                       SHORTCUT_ERR("Heap: %d\n", errno);
        }
 
        return language;
@@ -189,7 +189,7 @@ EAPI int shortcut_db_get_list(const char *package_name, GList **shortcut_list)
        handle = _open_db();
        if (!handle) {
                /* LCOV_EXCL_START */
-               ErrPrint("Failed to open a DB\n");
+               SHORTCUT_ERR("Failed to open a DB\n");
                return SHORTCUT_ERROR_IO_ERROR;
                /* LCOV_EXCL_STOP */
        }
@@ -197,7 +197,7 @@ EAPI int shortcut_db_get_list(const char *package_name, GList **shortcut_list)
        language = _cur_locale();
        if (!language) {
                /* LCOV_EXCL_START */
-               ErrPrint("Locale is not valid\n");
+               SHORTCUT_ERR("Locale is not valid\n");
                _close_db(&handle);
                return SHORTCUT_ERROR_FAULT;
                /* LCOV_EXCL_STOP */
@@ -208,7 +208,7 @@ EAPI int shortcut_db_get_list(const char *package_name, GList **shortcut_list)
                ret = sqlite3_prepare_v2(handle, query, -1, &stmt, NULL);
                if (ret != SQLITE_OK) {
                        /* LCOV_EXCL_START */
-                       ErrPrint("prepare: %s\n", sqlite3_errmsg(handle));
+                       SHORTCUT_ERR("prepare: %s\n", sqlite3_errmsg(handle));
                        free(language);
                        _close_db(&handle);
                        return SHORTCUT_ERROR_IO_ERROR;
@@ -218,7 +218,7 @@ EAPI int shortcut_db_get_list(const char *package_name, GList **shortcut_list)
                ret = sqlite3_bind_text(stmt, 1, package_name, -1, SQLITE_TRANSIENT);
                if (ret != SQLITE_OK) {
                        /* LCOV_EXCL_START */
-                       ErrPrint("bind text: %s\n", sqlite3_errmsg(handle));
+                       SHORTCUT_ERR("bind text: %s\n", sqlite3_errmsg(handle));
                        sqlite3_finalize(stmt);
                        free(language);
                        _close_db(&handle);
@@ -230,7 +230,7 @@ EAPI int shortcut_db_get_list(const char *package_name, GList **shortcut_list)
                ret = sqlite3_prepare_v2(handle, query, -1, &stmt, NULL);
                if (ret != SQLITE_OK) {
                        /* LCOV_EXCL_START */
-                       ErrPrint("prepare: %s\n", sqlite3_errmsg(handle));
+                       SHORTCUT_ERR("prepare: %s\n", sqlite3_errmsg(handle));
                        free(language);
                        _close_db(&handle);
                        return SHORTCUT_ERROR_IO_ERROR;
index 0bd82b7..26bd565 100755 (executable)
@@ -69,12 +69,12 @@ static void _add_shortcut_notify(GVariant *parameters)
        int sender_pid;
 
        g_variant_get(parameters, "(i&s&si&s&si)", &sender_pid, &appid, &name, &type, &content, &icon, &allow_duplicate);
-       DbgPrint("_add_shortcut_notify sender_pid: %d ", sender_pid);
+       SHORTCUT_DBG("_add_shortcut_notify sender pid : [%d] appid : [%s]", sender_pid, appid);
 
        if (_request_callback_info.request_cb != NULL)
                _request_callback_info.request_cb(appid, name, type, content, icon, sender_pid, -1.0f, allow_duplicate, _request_callback_info.data);
        else
-               DbgPrint("request_cb is null.");
+               SHORTCUT_DBG("request_cb is null.");
 }
 /* LCOV_EXCL_STOP */
 
@@ -91,11 +91,12 @@ static void _add_shortcut_widget_notify(GVariant *parameters)
        double period;
 
        g_variant_get(parameters, "(i&s&si&s&sdi)", &sender_pid, &appid, &name, &type, &content, &icon, &period, &allow_duplicate);
+       SHORTCUT_DBG("_add_shortcut_widget_notify sender pid : [%d] appid : [%s]", sender_pid, appid);
 
        if (_request_callback_info.request_cb != NULL)
                _request_callback_info.request_cb(appid, name, type, content, icon, sender_pid, period, allow_duplicate, _request_callback_info.data);
        else
-               DbgPrint("request_cb is null.");
+               SHORTCUT_DBG("request_cb is null.");
 }
 /* LCOV_EXCL_STOP */
 
@@ -106,12 +107,12 @@ static void _remove_shortcut_notify(GVariant *parameters)
        int sender_pid;
 
        g_variant_get(parameters, "(i&s&s)", &sender_pid, &appid, &name);
-       DbgPrint("_add_shortcut_notify sender_pid: %d ", sender_pid);
+       SHORTCUT_DBG("_remove_shortcut_notify sender pid : [%d] appid : [%s]", sender_pid, appid);
 
        if (_remove_callback_info.remove_cb != NULL)
                _remove_callback_info.remove_cb(appid, name, sender_pid, _remove_callback_info.data);
        else
-               DbgPrint("remove_cb is null.");
+               SHORTCUT_DBG("remove_cb is null.");
 }
 
 /* LCOV_EXCL_START */
@@ -123,7 +124,7 @@ static void _handle_shortcut_notify(GDBusConnection *connection,
                GVariant        *parameters,
                gpointer         user_data)
 {
-       DbgPrint("signal_name: %s", signal_name);
+       SHORTCUT_DBG("signal_name : [%s]", signal_name);
        if (g_strcmp0(signal_name, "add_shortcut_notify") == 0)
                _add_shortcut_notify(parameters);
        else if (g_strcmp0(signal_name, "add_shortcut_widget_notify") == 0)
@@ -144,7 +145,7 @@ int _dbus_init(void)
                        /* LCOV_EXCL_START */
                        if (error != NULL) {
 
-                               ErrPrint("Failed to get dbus [%s]", error->message);
+                               SHORTCUT_ERR("Failed to get dbus [%s]", error->message);
                                g_error_free(error);
 
                        }
@@ -163,7 +164,6 @@ int _dbus_signal_init()
        int id;
 
        if (monitor_id == 0) {
-               DbgPrint("get dbus connection success");
                id = g_dbus_connection_signal_subscribe(
                                _gdbus_conn,
                                PROVIDER_BUS_NAME,
@@ -175,14 +175,14 @@ int _dbus_signal_init()
                                _handle_shortcut_notify,
                                NULL,
                                NULL);
-
-               DbgPrint("subscribe id : %d", id);
+               SHORTCUT_DBG("subscribe id : %d", id);
                if (id == 0) {
                        /* LCOV_EXCL_START */
                        ret = SHORTCUT_ERROR_IO_ERROR;
-                       ErrPrint("Failed to _register_noti_dbus_interface");
+                       SHORTCUT_ERR("Failed to _register_noti_dbus_interface");
                        /* LCOV_EXCL_STOP */
                } else {
+                       SHORTCUT_INFO("get dbus connection success");
                        monitor_id = id;
                }
        }
@@ -229,7 +229,7 @@ char *_shortcut_get_pkgname_by_pid(void)
 
        dup_pkgname = strdup(pkgname);
        if (!dup_pkgname)
-               ErrPrint("Heap: %d\n", errno); /* LCOV_EXCL_LINE */
+               SHORTCUT_ERR("Heap: %d\n", errno); /* LCOV_EXCL_LINE */
 
        return dup_pkgname;
 }
@@ -250,7 +250,7 @@ int _send_sync_shortcut(GVariant *body, GDBusMessage **reply, char *cmd)
                        cmd);
        if (!msg) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't allocate new method call");
+               SHORTCUT_ERR("Can't allocate new method call");
                if (body)
                        g_variant_unref(body);
                return SHORTCUT_ERROR_OUT_OF_MEMORY;
@@ -275,7 +275,7 @@ int _send_sync_shortcut(GVariant *body, GDBusMessage **reply, char *cmd)
                /* LCOV_EXCL_START */
                ret = SHORTCUT_ERROR_COMM;
                if (err != NULL) {
-                       ErrPrint("No reply. cmd = %s,  error = %s", cmd, err->message);
+                       SHORTCUT_ERR("No reply. cmd = %s,  error = %s", cmd, err->message);
                        if (err->code == G_DBUS_ERROR_ACCESS_DENIED)
                                ret = SHORTCUT_ERROR_PERMISSION_DENIED;
                        g_error_free(err);
@@ -291,12 +291,12 @@ int _send_sync_shortcut(GVariant *body, GDBusMessage **reply, char *cmd)
                else
                        ret = err->code;
 
-               ErrPrint("_send_sync_shortcut error %s err code: %d", err->message, ret);
+               SHORTCUT_ERR("_send_sync_shortcut error %s err code: %d", err->message, ret);
                g_error_free(err);
                return ret;
                /* LCOV_EXCL_STOP */
        }
-       DbgPrint("_send_sync_shortcut done !!");
+       SHORTCUT_DBG("_send_sync_shortcut done !!");
        return SHORTCUT_ERROR_NONE;
 }
 
@@ -306,7 +306,7 @@ int _send_service_register()
        int result;
 
        result = _send_sync_shortcut(g_variant_new("(i)", getuid()), &reply, "shortcut_service_register");
-       ErrPrint("_send_service_register done");
+       SHORTCUT_ERR("_send_service_register done");
        return result;
 }
 
@@ -321,7 +321,7 @@ static void _send_message_with_reply_sync_cb(GDBusConnection *connection,
 
        if (cb_item == NULL) {
                /* LCOV_EXCL_START */
-               ErrPrint("Failed to get a callback item");
+               SHORTCUT_ERR("Failed to get a callback item");
                return;
                /* LCOV_EXCL_STOP */
        }
@@ -334,7 +334,7 @@ static void _send_message_with_reply_sync_cb(GDBusConnection *connection,
        if (!reply) {
                /* LCOV_EXCL_START */
                if (err != NULL) {
-                       ErrPrint("No reply. error = %s", err->message);
+                       SHORTCUT_ERR("No reply. error = %s", err->message);
                        g_error_free(err);
                }
                result = SHORTCUT_ERROR_COMM;
@@ -347,7 +347,7 @@ static void _send_message_with_reply_sync_cb(GDBusConnection *connection,
                else
                        result = err->code;
 
-               ErrPrint("_send_message_with_reply_sync_cb error %s err code: %d", err->message, result);
+               SHORTCUT_ERR("_send_message_with_reply_sync_cb error %s err code: %d", err->message, result);
                g_error_free(err);
                /* LCOV_EXCL_STOP */
        }
@@ -373,7 +373,7 @@ int _send_async_shortcut(GVariant *body, struct result_cb_item *cb_item, char *c
                        cmd);
        if (!msg) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't allocate new method call");
+               SHORTCUT_ERR("Can't allocate new method call");
                return SHORTCUT_ERROR_OUT_OF_MEMORY;
                /* LCOV_EXCL_STOP */
        }
@@ -391,7 +391,7 @@ int _send_async_shortcut(GVariant *body, struct result_cb_item *cb_item, char *c
                        (GAsyncReadyCallback)_send_message_with_reply_sync_cb,
                        cb_item);
 
-       DbgPrint("_send_async_shortcut done !!");
+       SHORTCUT_DBG("_send_async_shortcut done !!");
        return SHORTCUT_ERROR_NONE;
 }
 
@@ -415,7 +415,7 @@ static void _on_name_appeared(GDBusConnection *connection,
                const gchar     *name_owner,
                gpointer         user_data)
 {
-       DbgPrint("name appeared : %s", name);
+       SHORTCUT_DBG("name appeared : %s", name);
        _send_service_register();
 }
 /* LCOV_EXCL_STOP */
@@ -425,7 +425,7 @@ static void _on_name_vanished(GDBusConnection *connection,
                const gchar     *name,
                gpointer         user_data)
 {
-       DbgPrint("name vanished : %s", name);
+       SHORTCUT_DBG("name vanished : %s", name);
 }
 /* LCOV_EXCL_STOP */
 
@@ -467,7 +467,7 @@ int _dbus_set_watch_name()
 
                if (provider_monitor_id == 0) {
                        /* LCOV_EXCL_START */
-                       ErrPrint("watch on name fail");
+                       SHORTCUT_ERR("watch on name fail");
                        return SHORTCUT_ERROR_IO_ERROR;
                        /* LCOV_EXCL_STOP */
                }
index bbfd676..dcb164c 100755 (executable)
@@ -44,7 +44,7 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
        ret = _dbus_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus %d", ret);
+               SHORTCUT_ERR("Can't init dbus %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -52,7 +52,7 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
        ret = _dbus_signal_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus_signal %d", ret);
+               SHORTCUT_ERR("Can't init dbus_signal %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -60,7 +60,7 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
        ret = _send_service_register();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init ipc_monitor_register %d", ret);
+               SHORTCUT_ERR("Can't init ipc_monitor_register %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -68,7 +68,7 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
        ret = _dbus_set_watch_name();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init _dbus_set_watch_name %d", ret);
+               SHORTCUT_ERR("Can't init _dbus_set_watch_name %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -93,7 +93,7 @@ EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data)
        ret = _dbus_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus %d", ret);
+               SHORTCUT_ERR("Can't init dbus %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -101,7 +101,7 @@ EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data)
        ret = _dbus_signal_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus_signal %d", ret);
+               SHORTCUT_ERR("Can't init dbus_signal %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -109,7 +109,7 @@ EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data)
        ret = _send_service_register();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init ipc_monitor_register %d", ret);
+               SHORTCUT_ERR("Can't init ipc_monitor_register %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -117,7 +117,7 @@ EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data)
        ret = _dbus_set_watch_name();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init _dbus_set_watch_name %d", ret);
+               SHORTCUT_ERR("Can't init _dbus_set_watch_name %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -142,7 +142,7 @@ EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char *
 
        if (ADD_TO_HOME_IS_DYNAMICBOX(type)) {
                /* LCOV_EXCL_START */
-               ErrPrint("Invalid type used for adding a shortcut\n");
+               SHORTCUT_ERR("Invalid type used for adding a shortcut\n");
                return SHORTCUT_ERROR_INVALID_PARAMETER;
                /* LCOV_EXCL_STOP */
        }
@@ -150,7 +150,7 @@ EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char *
        ret = _dbus_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus %d", ret);
+               SHORTCUT_ERR("Can't init dbus %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -162,7 +162,7 @@ EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char *
        appid = _shortcut_get_pkgname_by_pid();
        if (appid == NULL) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't get appid");
+               SHORTCUT_ERR("Can't get appid");
                return SHORTCUT_ERROR_IO_ERROR;
                /* LCOV_EXCL_STOP */
        }
@@ -173,7 +173,7 @@ EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char *
                if (appid)
                        free(appid);
 
-               ErrPrint("Heap: %d\n", errno);
+               SHORTCUT_ERR("Heap: %d\n", errno);
                return SHORTCUT_ERROR_OUT_OF_MEMORY;
                /* LCOV_EXCL_STOP */
        }
@@ -218,13 +218,13 @@ EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e si
        GVariant *body;
 
        if (name == NULL) {
-               ErrPrint("AppID is null\n");
+               SHORTCUT_ERR("AppID is null\n");
                return SHORTCUT_ERROR_INVALID_PARAMETER;
        }
 
        if (!SHORTCUT_IS_WIDGET_SIZE(size)) {
                /* LCOV_EXCL_START */
-               ErrPrint("Invalid type used for adding a widget\n");
+               SHORTCUT_ERR("Invalid type used for adding a widget\n");
                return SHORTCUT_ERROR_INVALID_PARAMETER;
                /* LCOV_EXCL_STOP */
        }
@@ -232,7 +232,7 @@ EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e si
        ret = _dbus_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus %d", ret);
+               SHORTCUT_ERR("Can't init dbus %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -244,7 +244,7 @@ EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e si
        appid = _shortcut_get_pkgname_by_pid();
        if (appid == NULL) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't get appid");
+               SHORTCUT_ERR("Can't get appid");
                return SHORTCUT_ERROR_IO_ERROR;
                /* LCOV_EXCL_STOP */
        }
@@ -255,7 +255,7 @@ EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e si
                if (appid)
                        free(appid);
 
-               ErrPrint("Heap: %d\n", errno);
+               SHORTCUT_ERR("Heap: %d\n", errno);
                return SHORTCUT_ERROR_OUT_OF_MEMORY;
                /* LCOV_EXCL_STOP */
        }
@@ -290,14 +290,14 @@ EAPI int shortcut_remove_from_home(const char *name, result_cb_t result_cb, void
        GVariant *body;
 
        if (name == NULL) {
-               ErrPrint("name is NULL.");
+               SHORTCUT_ERR("name is NULL.");
                return SHORTCUT_ERROR_INVALID_PARAMETER;
        }
 
        ret = _dbus_init();
        if (ret != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus %d", ret);
+               SHORTCUT_ERR("Can't init dbus %d", ret);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -309,7 +309,7 @@ EAPI int shortcut_remove_from_home(const char *name, result_cb_t result_cb, void
        appid = _shortcut_get_pkgname_by_pid();
        if (appid == NULL) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't get appid");
+               SHORTCUT_ERR("Can't get appid");
                return SHORTCUT_ERROR_IO_ERROR;
                /* LCOV_EXCL_STOP */
        }
@@ -320,7 +320,7 @@ EAPI int shortcut_remove_from_home(const char *name, result_cb_t result_cb, void
                if (appid)
                        free(appid);
 
-               ErrPrint("Heap: %d\n", errno);
+               SHORTCUT_ERR("Heap: %d\n", errno);
                return SHORTCUT_ERROR_OUT_OF_MEMORY;
                /* LCOV_EXCL_STOP */
        }
@@ -365,7 +365,7 @@ EAPI int shortcut_get_list(const char *package_name, shortcut_list_cb list_cb, v
        result = _dbus_init();
        if (result != SHORTCUT_ERROR_NONE) {
                /* LCOV_EXCL_START */
-               ErrPrint("Can't init dbus %d", result);
+               SHORTCUT_ERR("Can't init dbus %d", result);
                return result;
                /* LCOV_EXCL_STOP */
        }
@@ -379,11 +379,11 @@ EAPI int shortcut_get_list(const char *package_name, shortcut_list_cb list_cb, v
        if (result == SHORTCUT_ERROR_NONE) {
                reply_body = g_dbus_message_get_body(reply);
                g_variant_get(reply_body, "(ia(v))", &ret, &iter);
-               DbgPrint("shortcut count : %d", ret);
+               SHORTCUT_DBG("shortcut count : %d", ret);
                while (g_variant_iter_loop(iter, "(v)", &iter_body)) {
                        g_variant_get(iter_body, "(&s&s&s&s&s)",
                                &shortcut.package_name, &shortcut.icon, &shortcut.name, &shortcut.extra_key, &shortcut.extra_data);
-                       DbgPrint("call calback : %s", shortcut.package_name);
+                       SHORTCUT_DBG("call calback : %s", shortcut.package_name);
                        list_cb(shortcut.package_name, shortcut.icon, shortcut.name, shortcut.extra_key, shortcut.extra_data, data);
                }
                g_variant_iter_free(iter);