From: jusung son Date: Thu, 29 Jun 2017 05:08:32 +0000 (+0900) Subject: Adjust log level X-Git-Tag: submit/tizen/20170629.060228~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F136308%2F1;p=platform%2Fcore%2Fappfw%2Fmessage-port.git Adjust log level Change-Id: I01d7ad4fdba9a6989d79968a5372fafb68e3bafc Signed-off-by: jusung son --- diff --git a/src/inc/message-port-log.h b/src/inc/message-port-log.h old mode 100644 new mode 100755 index 2393106..e32eccf --- a/src/inc/message-port-log.h +++ b/src/inc/message-port-log.h @@ -31,9 +31,11 @@ extern "C" { #define _LOGE(fmt, arg...) LOGE(fmt, ##arg) #define _LOGI(fmt, arg...) LOGI(fmt, ##arg) +#define _LOGD(fmt, arg...) LOGD(fmt, ##arg) #define _SECURE_LOGE(fmt, arg...) SECURE_LOGE(fmt, ##arg) #define _SECURE_LOGI(fmt, arg...) SECURE_LOGI(fmt, ##arg) +#define _SECURE_LOGD(fmt, arg...) SECURE_LOGD(fmt, ##arg) /** * @} diff --git a/src/inc/message_port_log.h b/src/inc/message_port_log.h old mode 100644 new mode 100755 index 6055516..499f429 --- a/src/inc/message_port_log.h +++ b/src/inc/message_port_log.h @@ -26,8 +26,10 @@ #define _LOGE(fmt, arg...) LOGE(fmt, ##arg) #define _LOGI(fmt, arg...) LOGI(fmt, ##arg) +#define _LOGD(fmt, arg...) LOGD(fmt, ##arg) #define _SECURE_LOGE(fmt, arg...) SECURE_LOGE(fmt, ##arg) #define _SECURE_LOGI(fmt, arg...) SECURE_LOGI(fmt, ##arg) +#define _SECURE_LOGD(fmt, arg...) SECURE_LOGD(fmt, ##arg) #endif /* __TIZEN_APPFW_MESSAGE_PORT_LOG_H__ */ diff --git a/src/message-port.c b/src/message-port.c index 53a0f73..3a0a29e 100755 --- a/src/message-port.c +++ b/src/message-port.c @@ -299,7 +299,7 @@ static char *__get_encoded_name(const char *remote_app_id, const char *port_name if (bus_name) free(bus_name); - _LOGI("encoded_bus_name : %s ", md5_interface); + _LOGD("encoded_bus_name : %s ", md5_interface); return md5_interface; } @@ -318,7 +318,7 @@ static int __remote_port_compare_cb(gconstpointer a, gconstpointer b) static bool __is_preloaded(const char *local_appid, const char *remote_appid) { - _LOGI("IsPreloaded"); + _LOGD("IsPreloaded"); bool preload_local = false; bool preload_remote = false; @@ -361,7 +361,7 @@ static bool __is_preloaded(const char *local_appid, const char *remote_appid) static int __check_certificate(const char *local_appid, const char *remote_appid) { - _LOGI("CheckCertificate"); + _LOGD("CheckCertificate"); pkgmgrinfo_cert_compare_result_type_e res; int ret = pkgmgrinfo_pkginfo_compare_usr_app_cert_info(local_appid, remote_appid, getuid(), &res); @@ -382,7 +382,7 @@ static void on_name_appeared(GDBusConnection *connection, const gchar *name_owner, gpointer user_data) { - _LOGI("name appeared : %s %s", __app_id, name); + _LOGD("name appeared : %s %s", __app_id, name); } static void on_name_vanished(GDBusConnection *connection, @@ -396,7 +396,7 @@ static void on_name_vanished(GDBusConnection *connection, return; } - _LOGI("watcher_id :%d", pli->watcher_id); + _LOGD("watcher_id :%d", pli->watcher_id); if (pli->watcher_id > 0) g_bus_unwatch_name(pli->watcher_id); else @@ -542,7 +542,7 @@ static void __watch_remote_port_info(port_list_info_s *port_info) port_info, NULL); } else { - LOGI("Already watched port info"); + LOGD("Already watched port info"); return; } } @@ -1035,7 +1035,7 @@ static bool send_message(GVariant *parameters, GDBusMethodInvocation *invocation goto out; } - LOGI("call calback %s", local_appid); + LOGD("call calback %s", local_appid); if (bi_dir) mi->callback(mi->local_id, local_appid, local_port, local_trusted, data, NULL); else @@ -1050,7 +1050,7 @@ out: static int __check_remote_port(const char *remote_app_id, const char *remote_port, bool is_trusted, bool *exist) { - _LOGI("Check a remote port : [%s:%s]", remote_app_id, remote_port); + _LOGD("Check a remote port : [%s:%s]", remote_app_id, remote_port); GVariant *result = NULL; GError *err = NULL; @@ -1062,7 +1062,7 @@ static int __check_remote_port(const char *remote_app_id, const char *remote_por message_port_local_port_info_s *mi = NULL; gboolean name_exist = false; - _LOGI("remote_app_id, app_id :[%s : %s] ", remote_app_id, __app_id); + _LOGD("remote_app_id, app_id :[%s : %s] ", remote_app_id, __app_id); ret_val = __get_remote_port_info(remote_app_id, remote_port, is_trusted, &remote_app_info, &port_info); if (ret_val != MESSAGEPORT_ERROR_NONE) @@ -1071,13 +1071,13 @@ static int __check_remote_port(const char *remote_app_id, const char *remote_por /* self check */ if (strcmp(remote_app_id, __app_id) == 0) { - _LOGI("__is_local_port_registed "); + _LOGD("__is_local_port_registed "); if (!__is_local_port_registed(remote_port, is_trusted, &local_reg_id, &mi)) *exist = false; else *exist = true; - _LOGI("__is_local_port_registed : %d ", *exist); + _LOGD("__is_local_port_registed : %d ", *exist); return MESSAGEPORT_ERROR_NONE; } @@ -1188,7 +1188,7 @@ static bool __check_sender_validation(GVariant *parameters, const char *sender, } if (strncmp(buffer, local_appid, MAX_PACKAGE_STR_SIZE) == 0) { - _LOGI("insert sender !!!!! %s", sender); + _LOGD("insert sender !!!!! %s", sender); g_hash_table_insert(__sender_appid_hash, (gpointer)strdup(sender), GINT_TO_POINTER(pid)); *watcher_id = g_bus_watch_name_on_connection( __gdbus_conn, @@ -1333,7 +1333,7 @@ int __register_dbus_interface(const char *port_name, bool is_trusted) goto out; } - _LOGI("Acquiring the own name : %d", owner_id); + _LOGD("Acquiring the own name : %d", owner_id); snprintf(introspection_xml, introspection_xml_len, "%s%s%s", introspection_prefix, interface_name, introspection_postfix); @@ -1347,7 +1347,7 @@ int __register_dbus_interface(const char *port_name, bool is_trusted) MESSAGEPORT_OBJECT_PATH, introspection_data->interfaces[0], &interface_vtable, NULL, NULL, NULL); - _LOGI("registration_id %d", registration_id); + _LOGD("registration_id %d", registration_id); if (registration_id == 0) { _LOGE("Failed to g_dbus_connection_register_object"); @@ -1417,7 +1417,6 @@ static bool __initialize(void) int ret = 0; char buffer[MAX_PACKAGE_STR_SIZE] = {0, }; - _LOGI("initialize"); ret = aul_app_get_appid_bypid(pid, buffer, sizeof(buffer)); retvm_if(ret != AUL_R_OK, false, "Failed to get the application ID: %d", ret); @@ -1479,7 +1478,7 @@ static bool __message_port_register_port(const int local_id, const char *local_p static int __register_message_port(const char *local_port, bool is_trusted, messageport_message_cb callback) { - _SECURE_LOGI("Register a message port : [%s:%s]", __app_id, local_port); + _SECURE_LOGI("local_port : [%s:%s]", local_port, is_trusted ? "trusted" : "non-trusted"); int local_id = 0; @@ -1851,7 +1850,7 @@ static int __message_port_send_message(const char *remote_appid, const char *rem if (port_info->exist == false) { bool exist = false; - _LOGI("port exist check !!"); + _LOGD("port exist check !!"); ret = __check_remote_port(remote_appid, remote_port, trusted_message, &exist); if (ret != MESSAGEPORT_ERROR_NONE) { goto out; @@ -1968,7 +1967,7 @@ int __message_send_bidirectional_message(int id, const char *remote_app_id, cons if (ret != MESSAGEPORT_ERROR_NONE) return ret; - _LOGI("bidirectional_message %s", local_info->port_name); + _LOGD("bidirectional_message %s", local_info->port_name); return __message_port_send_message(remote_app_id, remote_port, local_info->port_name, trusted_message, local_info->is_trusted, true, message); } diff --git a/src/message_port.c b/src/message_port.c index 2629c35..7044870 100755 --- a/src/message_port.c +++ b/src/message_port.c @@ -70,7 +70,7 @@ int message_port_register_local_port(const char *local_port, message_port_messag int local_port_id = messageport_register_local_port(local_port, message_dispatcher); if (local_port_id > 0) { - _SECURE_LOGI("Register local port ID (%d).", local_port_id); + _LOGD("Register local port ID (%d).", local_port_id); if (__listeners == NULL) __listeners = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free); @@ -93,7 +93,7 @@ int message_port_register_local_port(const char *local_port, message_port_messag pthread_mutex_unlock(&mutex); } else { - _SECURE_LOGI("Register local port fail (%d).", local_port_id); + _SECURE_LOGE("Register local port fail (%d).", local_port_id); } return convert_to_tizen_error((messageport_error_e)local_port_id); @@ -108,7 +108,7 @@ int message_port_register_trusted_local_port(const char *local_port, message_por int trusted_local_port_id = messageport_register_trusted_local_port(local_port, trusted_message_dispatcher); if (trusted_local_port_id > 0) { - _SECURE_LOGI("Register trusted local port ID (%d).", trusted_local_port_id); + _SECURE_LOGD("Register trusted local port ID (%d).", trusted_local_port_id); if (__trusted_listeners == NULL) __trusted_listeners = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free); @@ -170,7 +170,7 @@ int message_port_check_remote_port(const char *remote_app_id, const char *remote _LOGE("[MESSAGE_PORT_ERROR_INVALID_PARAMETER] NULL value is not allowed."); return MESSAGE_PORT_ERROR_INVALID_PARAMETER; } - _SECURE_LOGI("Check remote port (%s):(%s).", remote_app_id, remote_port); + _LOGD("Check remote port (%s):(%s).", remote_app_id, remote_port); return convert_to_tizen_error((messageport_error_e)messageport_check_remote_port(remote_app_id, remote_port, exist)); } @@ -180,7 +180,7 @@ int message_port_check_trusted_remote_port(const char *remote_app_id, const char _LOGE("[MESSAGE_PORT_ERROR_INVALID_PARAMETER] NULL value is not allowed."); return MESSAGE_PORT_ERROR_INVALID_PARAMETER; } - _SECURE_LOGI("Check trusted remote port (%s):(%s).", remote_app_id, remote_port); + _LOGD("Check trusted remote port (%s):(%s).", remote_app_id, remote_port); return convert_to_tizen_error((messageport_error_e)messageport_check_trusted_remote_port(remote_app_id, remote_port, exist)); } @@ -243,7 +243,7 @@ int message_port_send_message_with_local_port(const char *remote_app_id, const c } } - _SECURE_LOGI("Send a message to (%s):(%s) and listen at the local port ID (%d).", remote_app_id, remote_port, local_port_id); + _SECURE_LOGI("Send a message to (%s):(%s) - (%d).", remote_app_id, remote_port, local_port_id); pthread_mutex_lock(&mutex); ret = messageport_send_bidirectional_message(local_port_id, remote_app_id, remote_port, message); pthread_mutex_unlock(&mutex); @@ -276,7 +276,7 @@ int message_port_send_trusted_message_with_local_port(const char *remote_app_id, } } - _SECURE_LOGI("Send a trusted message to (%s):(%s) and listen at the local port ID (%d).", remote_app_id, remote_port, local_port_id); + _SECURE_LOGI("Send a trusted message to (%s):(%s) - (%d).", remote_app_id, remote_port, local_port_id); pthread_mutex_lock(&mutex); ret = messageport_send_bidirectional_trusted_message(local_port_id, remote_app_id, remote_port, message); pthread_mutex_unlock(&mutex);