Update log level to get log for product 22/244922/7
authorhj kim <backto.kim@samsung.com>
Mon, 28 Sep 2020 01:24:31 +0000 (10:24 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 28 Sep 2020 04:22:55 +0000 (13:22 +0900)
Change-Id: I9cd72229a715f872af7090b71d6a08a04aeb9a05

include/media_controller_private.h
packaging/capi-media-controller.spec
src/media_controller_client.c
src/media_controller_ipc.c
src/media_controller_server.c
svc/media_controller_db_util.c
svc/media_controller_svc.c

index 379aa78b45bbb4834aa51c8687065ff25feb9cf6..63c6261296ccb2c52d4588f0f9da87e4f7084c3b 100644 (file)
@@ -82,7 +82,15 @@ extern "C" {
        } while (0)
 
 #define mc_debug_fleave() do { \
-               LOGD(FONT_COLOR_YELLOW"<Leave>"FONT_COLOR_RESET);     \
+               LOGD(FONT_COLOR_YELLOW"<LEAVE>"FONT_COLOR_RESET);     \
+       } while (0)
+
+#define mc_info_fenter() do { \
+               LOGI(FONT_COLOR_GREEN"<ENTER>"FONT_COLOR_RESET); \
+       } while (0)
+
+#define mc_info_fleave() do { \
+               LOGI(FONT_COLOR_GREEN"<LEAVE>"FONT_COLOR_RESET);     \
        } while (0)
 
 #define mc_retm_if_failed(expr) do { \
index dfca9a5f5743e2fba496d81d4b5eb503b3b34df0..46d106075ed4c9f5e45a293a15696e1623b9d517 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-controller
 Summary:    A media controller library in Tizen Native API
-Version:    0.2.20
+Version:    0.2.21
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index f9674b7e4a84f17e53ebe8a97f0766882c4da404..86a8a3b4735dfb9f9fd6bd7c43d595d9bba77d75 100644 (file)
@@ -594,7 +594,7 @@ int mc_client_create(mc_client_h *client)
        int ret = MEDIA_CONTROLLER_ERROR_NONE;
        media_controller_client_s *mc_client = NULL;
 
-       mc_debug_fenter();
+       mc_info_fenter();
 
        mc_retvm_if(client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
 
@@ -611,7 +611,7 @@ int mc_client_create(mc_client_h *client)
 
        *client = (mc_client_h)mc_client;
 
-       mc_debug_fleave();
+       mc_info_fleave();
 
        return MEDIA_CONTROLLER_ERROR_NONE;
 }
@@ -1611,7 +1611,7 @@ int mc_client_destroy(mc_client_h client)
        media_controller_client_s *mc_client = (media_controller_client_s *)client;
        int idx = 0;
 
-       mc_debug_fenter();
+       mc_info_fenter();
 
        mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
 
@@ -1629,7 +1629,7 @@ int mc_client_destroy(mc_client_h client)
 
        ret = __mc_client_destroy(mc_client);
 
-       mc_debug_fleave();
+       mc_info_fleave();
 
        return ret;
 }
index c1f7c68f108c0f5c3e11468d6b300b45c5fc193a..d30a4590005f62d73ea913ab5c6b44c47dfaaba0 100644 (file)
@@ -60,7 +60,7 @@ static void __dbus_signal_cb(GDBusConnection *connection,
        gchar *message = NULL;
        gchar *request_id = NULL;
 
-       mc_debug_fenter();
+       mc_info_fenter();
 
        g_variant_get(parameters, "(&s&s)", &request_id, &message);
        mc_retm_if_failed(message);
@@ -72,7 +72,7 @@ static void __dbus_signal_cb(GDBusConnection *connection,
        mc_secure_debug("Received: [%s] (id: %s) from %s.%s", message, request_id, interface_name, signal_name);
        listener->callback(interface_name, signal_name, message, request_id, listener->user_data);
 
-       mc_debug_fleave();
+       mc_info_fleave();
 }
 
 static void __free_dbus_listener(gpointer data)
@@ -121,6 +121,7 @@ static int __dbus_send_message(GDBusConnection *connection, const char *dbus_nam
        mc_retvm_if(!MC_STRING_VALID(signal_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid signal_name");
        mc_retvm_if(!MC_STRING_VALID(message), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid message");
 
+       mc_info_fenter();
        mc_secure_debug("emit signal - interface_name [%s], signal_name [%s]", interface_name, signal_name);
 
        emmiting = g_dbus_connection_emit_signal(
@@ -137,6 +138,8 @@ static int __dbus_send_message(GDBusConnection *connection, const char *dbus_nam
                return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
        }
 
+       mc_info_fleave();
+
        return MEDIA_CONTROLLER_ERROR_NONE;
 }
 
index b0e639a2b94434a4e465d1e2e54d07b361a08b0b..d3abbbed199df58d346041693020d53d4f1a892d 100644 (file)
@@ -1446,7 +1446,7 @@ int mc_server_create(mc_server_h *server)
        int ret = MEDIA_CONTROLLER_ERROR_NONE;
        media_controller_server_s *mc_server = NULL;
 
-       mc_debug_fenter();
+       mc_info_fenter();
 
        mc_retvm_if(server == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is null");
 
@@ -1472,7 +1472,7 @@ int mc_server_create(mc_server_h *server)
 
        *server = (mc_server_h)mc_server;
 
-       mc_debug_fleave();
+       mc_info_fleave();
 
        return MEDIA_CONTROLLER_ERROR_NONE;
 }
@@ -1482,7 +1482,7 @@ int mc_server_destroy(mc_server_h server)
        int ret = MEDIA_CONTROLLER_ERROR_NONE;
        media_controller_server_s *mc_server = (media_controller_server_s *)server;
 
-       mc_debug_fenter();
+       mc_info_fenter();
 
        mc_retvm_if(mc_server == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
 
@@ -1498,7 +1498,7 @@ int mc_server_destroy(mc_server_h server)
        if (ret != MEDIA_CONTROLLER_ERROR_NONE)
                mc_error("fail __mc_server_destoy [%d]", ret);
 
-       mc_debug_fleave();
+       mc_info_fleave();
 
        return ret;
 }
index 6771c4c4fc3079a6917d9c9689f2935054c8fe9f..6c9ef7077491f9b512c53a311674938a769c4848 100644 (file)
@@ -48,19 +48,19 @@ static char *__mc_db_get_user_path(uid_t uid)
 
        ret = tzplatform_context_create(&ctx);
        if (ret != 0) {
-               mc_secure_error("Fail tzplatform_context_create");
+               mc_error("Fail tzplatform_context_create");
                goto ERROR;
        }
 
        ret = tzplatform_context_set_user(ctx, uid);
        if (ret != 0) {
-               mc_secure_error("Fail tzplatform_context_set_user");
+               mc_error("Fail tzplatform_context_set_user");
                goto ERROR;
        }
 
        path = g_strdup(tzplatform_context_mkpath(ctx, TZ_USER_DB, MC_DB_NAME));
        if (!MC_STRING_VALID(path))
-               mc_secure_error("Fail to get the path");
+               mc_error("Fail to get the path");
 
 ERROR:
        if (ctx != NULL)
@@ -75,7 +75,7 @@ static int __mc_db_busy_handler(void *pData, int count)
 {
        MC_MILLISEC_SLEEP(50);
 
-       mc_debug("__mc_db_busy_handler called : %d", count);
+       mc_error("[No-Error]__mc_db_busy_handler called : %d", count);
 
        return 100 - count;
 }
@@ -853,7 +853,7 @@ int mc_db_add_application(uid_t uid, const char *app_id, const mc_priv_type_e pr
        if (priv_type == MC_PRIV_TYPE_SERVER) {
                ret = __mc_db_activate_server(db_handle, app_id);
                if (ret != MEDIA_CONTROLLER_ERROR_NONE) {
-                       mc_secure_error("__mc_db_activate_server_table failed (%d)", ret);
+                       mc_error("__mc_db_activate_server failed [%d]", ret);
                        __mc_db_delete_from_list(db_handle, app_id, priv_type);
                }
        }
@@ -877,7 +877,7 @@ int mc_db_remove_application(uid_t uid, const char *app_id, const mc_priv_type_e
        /* Delete application from app list */
        ret = __mc_db_delete_from_list(db_handle, app_id, priv_type);
        if (ret != MEDIA_CONTROLLER_ERROR_NONE)
-               mc_secure_error("__mc_db_delete_from_list error : %d", ret);
+               mc_error("__mc_db_delete_from_list failed [%d]", ret);
 
        /* Update application information if it is latest server */
        if ((priv_type == MC_PRIV_TYPE_SERVER) && (__mc_db_is_latest(db_handle, app_id))) {
index e01f78f0f2cc83d1e7bb49c9c00a115afe31dddd..2eeb6108fef15ed4b75c24f377bae1161130330a 100644 (file)
@@ -174,12 +174,12 @@ static int __mc_list_remove_item(GList **list, int index)
        mc_retvm_if(list == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "invalid list");
        mc_retvm_if(index < 0 || index >= (int)g_list_length(*list), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "invalid index");
 
-       mc_secure_error("[No-error] index : %d", index);
+       mc_info("index : %d", index);
 
        found = g_list_nth(*list, index);
 
        if (!found) {
-               mc_secure_debug("app_data has been already removed.");
+               mc_error("[No-Error] already removed.");
                return MEDIA_CONTROLLER_ERROR_NONE;
        }
 
@@ -399,8 +399,6 @@ static int __mc_service_add_connection(GList **connected_list, mc_comm_msg_s *re
 
        mc_error("[No-error] increased connection count [%d]", g_connection_cnt);
 
-       mc_debug_fleave();
-
        return MEDIA_CONTROLLER_ERROR_NONE;
 }
 
@@ -417,8 +415,6 @@ static int __mc_service_remove_connection(GList **connected_list, mc_comm_msg_s
        g_connection_cnt--;
        mc_error("[No-error] decreased connection count [%d]", g_connection_cnt);
 
-       mc_debug_fleave();
-
        return MEDIA_CONTROLLER_ERROR_NONE;
 }
 
@@ -510,17 +506,17 @@ static int __mc_service_app_dead_handler(int pid, void *data)
 
                /* Delete and update information of dead application on database */
                if (MEDIA_CONTROLLER_ERROR_NONE != mc_db_remove_application(_app_data->uid, _app_data->app_id, _app_data->priv_type))
-                       mc_secure_error("Fail to remove dead application");
+                       mc_error("Fail to remove dead application");
 
                /* Sends notification for deactivated server via dbus */
                if (_app_data->priv_type == MC_PRIV_TYPE_SERVER) {
                        if (MEDIA_CONTROLLER_ERROR_NONE != __mc_notify_server_updated(_app_data->app_id, MC_SERVER_STATE_DEACTIVATE))
-                               mc_secure_error("Fail to notify deactivated server");
+                               mc_error("Fail to notify deactivated server");
                }
 
                _service_data->connected_apps = g_list_remove_link(_service_data->connected_apps, iter);
                g_list_free_full(iter, __mc_destroy_connected_apps);
-               mc_secure_error("[No-error] decreased connection count [%d]", --g_connection_cnt);
+               mc_error("[No-error] decreased connection count [%d]", --g_connection_cnt);
        }
 
        return AUL_R_OK;
@@ -538,7 +534,7 @@ static gboolean __mc_service_process(gpointer data)
        GQueue *request_queue = _service_data->request->queue;
        length_of_queue = g_queue_get_length(request_queue);
 
-       mc_debug("Queue Length : %d", length_of_queue);
+       mc_info("Queue Length : %d", length_of_queue);
 
        if (length_of_queue <= 0) {
                mc_debug("There is no request job in the queue");
@@ -572,6 +568,8 @@ static gboolean __mc_service_process(gpointer data)
                goto ERROR;
        }
 
+       mc_info("msg_type : [%d]", request_msg->msg_type);
+
        switch (request_msg->msg_type) {
        case MC_MSG_DB_UPDATE:
                send_msg = mc_db_request(request_msg->uid, request_msg->msg, request_msg->msg_size);
@@ -627,7 +625,7 @@ static gboolean __mc_read_service_request_tcp_socket(GIOChannel *src, GIOConditi
        mc_service_t *_service_data = (mc_service_t*)data;
        GQueue *request_queue = _service_data->request->queue;
 
-       mc_debug_fenter();
+       mc_info_fenter();
 
        sock = g_io_channel_unix_get_fd(src);
        if (sock < 0) {
@@ -682,7 +680,7 @@ static gboolean __mc_read_service_request_tcp_socket(GIOChannel *src, GIOConditi
                goto ERROR;
        }
 
-       mc_debug("msg(%d) is queued", req->req_msg->msg_type);
+       mc_info("msg(%d) is queued", req->req_msg->msg_type);
        g_queue_push_tail(request_queue, (gpointer)req);
 
        /* push received message to queue */