Refine log levels and messages for better analysis 92/221592/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 3 Jan 2020 10:48:35 +0000 (19:48 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 6 Jan 2020 05:38:09 +0000 (14:38 +0900)
Change-Id: I2bd416bc73b029792ed726ca59ece7f6e2b530bf

plugins/wakeup-manager/inc/wakeup_manager_main.h
plugins/wakeup-manager/src/wakeup_audio_manager.cpp
plugins/wakeup-manager/src/wakeup_engine_manager.cpp
plugins/wakeup-manager/src/wakeup_manager.cpp
src/multi_assistant_dbus.c
src/multi_assistant_dbus_server.c

index 80ce706ca24da3edbf9494a464e74f03e0bd8719..0a654c8b8c2a79b9ed2f199ae57335c883d50f2a 100644 (file)
@@ -12,7 +12,7 @@ extern "C" {
 #ifdef  LOG_TAG
 #undef  LOG_TAG
 #endif
-#define LOG_TAG "wakeup-manager"
+#define LOG_TAG "multi-assistant"
 
 #ifdef __MODULE__
 #undef  __MODULE__
index 6a76a4fe857e195b8e57a4a9c471159ec4b8ffb0..efefeae425d05f8c915b89163d7d06bc9ee3e795 100644 (file)
@@ -166,7 +166,7 @@ void CAudioManager::set_recording_session(recording_session session)
 /* Need to consider adapting conventional producer-consumer model */
 void CAudioManager::streaming_previous_audio_data_thread_func()
 {
-       MWR_LOGD("[ENTER]");
+       MWR_LOGI("[ENTER]");
 
        unique_lock<mutex> lock(mMutex, defer_lock);
 
@@ -200,12 +200,12 @@ void CAudioManager::streaming_previous_audio_data_thread_func()
        }
        lock.unlock();
 
-       MWR_LOGD("[EXIT]");
+       MWR_LOGI("[EXIT]");
 }
 
 void CAudioManager::streaming_audio_data_thread_func(long start_time)
 {
-       MWR_LOGD("[ENTER]");
+       MWR_LOGI("[ENTER]");
 
        unique_lock<mutex> lock(mMutex, defer_lock);
        bool finish_event_sent = false;
@@ -247,7 +247,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
                                        advance(lead, 1);
                                }
                                if (lead != end) {
-                                       MWR_LOGI("[INFO] Resume thread");
+                                       MWR_LOGD("[INFO] Resume thread");
                                        break;
                                }
                                if (g_speech_pcm_wait_count < cnt) {
@@ -265,12 +265,11 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
                                                        }
                                                }
                                        }
-                                       MWR_LOGD("[EXIT]");
                                        return;
                                }
                                cnt++;
                        }
-                       MWR_LOGI("[INFO] Finish to wait for new feedback data come");
+                       MWR_LOGD("[INFO] Finish to wait for new feedback data come");
 
                        /* resume feedback thread */
                        continue;
@@ -310,7 +309,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
                        }
                }
        }
-       MWR_LOGD("[EXIT]");
+       MWR_LOGI("[EXIT]");
 }
 
 void CAudioManager::add_audio_data(mas_speech_data& data, long time)
index f374d581dec86a6f9a23e1e033bd3ff1035fb149..01372c751b03579ec42853c32e87b7bbbdce48ab 100644 (file)
@@ -185,7 +185,7 @@ bool CWakeupEngineManager::set_assistant_language(string appid, string language)
                if (info.assistant_list.end() != iter) {
                        try {
                                int ret = info.interface.set_language(language.c_str());
-                               MWR_LOGD("set_language returned %d : %s %s %s",
+                               MWR_LOGI("set_language returned %d : %s %s %s",
                                        ret, appid.c_str(), info.engine_name.c_str(), language.c_str());
                        } catch (const std::exception& e) {
                                MWR_LOGE("[ERROR] wakeup engine %s threw exception : %s",
@@ -198,7 +198,7 @@ bool CWakeupEngineManager::set_assistant_language(string appid, string language)
 
 void CWakeupEngineManager::set_assistant_activated(string appid, bool activated)
 {
-       MWR_LOGD("[ENTER] : %s %d", appid.c_str(), activated);
+       MWR_LOGI("[ENTER] : %s %d", appid.c_str(), activated);
        for (auto& info : mEngineInfo) {
                const auto& iter = find_if(info.assistant_list.begin(), info.assistant_list.end(),
                        [appid](const string& assistant) {
@@ -255,7 +255,7 @@ void CWakeupEngineManager::set_wake_word_audio_require_flag(bool require)
 
 void CWakeupEngineManager::streaming_speech_data_thread_func()
 {
-       MWR_LOGD("[ENTER]");
+       MWR_LOGI("[ENTER]");
 
        if (nullptr == mSelectedEngine)
                return;
@@ -325,7 +325,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                                while (!(mStopStreamingThread.load())) {
                                        this_thread::sleep_for(chrono::milliseconds(10));
                                        if (index < interface->get_utterance_data_count()) {
-                                               MWR_LOGI("[INFO] Resume thread");
+                                               MWR_LOGD("[INFO] Resume thread");
                                                break;
                                        }
                                        if (g_speech_pcm_wait_count < cnt) {
@@ -347,7 +347,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                                        }
                                        cnt++;
                                }
-                               MWR_LOGI("[INFO] Finish to wait for new feedback data come");
+                               MWR_LOGD("[INFO] Finish to wait for new feedback data come");
 
                                /* resume feedback thread */
                                continue;
@@ -383,6 +383,8 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                        }
                }
        }
+
+       MWR_LOGI("[EXIT]");
 }
 
 void CWakeupEngineManager::start_streaming_current_utterance_data()
@@ -587,7 +589,7 @@ bool CWakeupEngineManager::on_error(string engine_name, int error_code, string e
 
 bool CWakeupEngineManager::on_audio_data_require_status(string engine_name, bool require)
 {
-       MWR_LOGD("[ENTER] %s, %d", engine_name.c_str(), require);
+       MWR_LOGI("[ENTER] %s, %d", engine_name.c_str(), require);
 
        bool found = false;
        // LOCK REQUIRED
index c4e42cffa8bebe1ef8e290e750269e3018838bdc..b2c427d9e178636d56586907dc823a3d0b176a15 100644 (file)
@@ -392,6 +392,7 @@ bool CWakeupManager::set_streaming_mode(STREAMING_MODE mode)
 
 bool CWakeupManager::change_manager_state(wakeup_manager_state_e state)
 {
+       MWR_LOGI("[ENTER] : %d", state);
        mWakeupManagerState = state;
        mWakeupEngineManager.update_manager_state(state);
        for (const auto& observer : mWakeupObservers) {
@@ -573,7 +574,7 @@ vector<ISettingValueObserver*> CWakeupManager::get_setting_observers()
 
 static Eina_Bool streaming_duration_expired(void *data)
 {
-       MWR_LOGD("[ENTER]");
+       MWR_LOGW("[ENTER]");
        CWakeupManager *wakeup_manager = static_cast<CWakeupManager*>(data);
        if (nullptr == wakeup_manager) return ECORE_CALLBACK_CANCEL;
 
index eab7619745d5631d15df5b707f09fb4da06e0d31..34de016db6aceef1980a85c81a7ff51f4e9b523c 100644 (file)
@@ -162,7 +162,7 @@ int masc_dbus_send_error_message(int reason, const char* err_msg)
        if (!dbus_connection_send(g_conn_sender, msg, NULL)) {
                MAS_LOGE("[Dbus ERROR] <<<< error message : Out Of Memory !");
        } else {
-               MAS_LOGD("<<<< Send error message : reason(%d), err_msg(%s)", reason, temp_err_msg);
+               MAS_LOGI("<<<< Send error message : reason(%d), err_msg(%s)", reason, temp_err_msg);
                dbus_connection_flush(g_conn_sender);
        }
 
@@ -219,7 +219,7 @@ int masc_dbus_send_streaming_audio_data(int pid, int event, unsigned char* data,
        } else {
                static int last_event = -1;
                if (event != last_event) {
-                       MAS_LOGI("[Dbus DEBUG] Success to Send utterance stream : event (%d)", event);
+                       MAS_LOGI("[Dbus DEBUG] Success to Send utterance stream : %d event (%d)", pid, event);
                }
                last_event = event;
                dbus_connection_flush(g_conn_sender);
@@ -272,7 +272,7 @@ int masc_dbus_active_state_change(int pid, int state)
                MAS_LOGE("[Dbus ERROR] Fail to Send");
                return -1; // MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[Dbus DEBUG] Success to Send activate message : %d", state);
+               MAS_LOGI("[Dbus DEBUG] Success to Send activate message : %d %d", pid, state);
                dbus_connection_flush(g_conn_sender);
        }
 
@@ -333,7 +333,7 @@ int masc_dbus_send_preprocessing_information(int pid, const char* app_id)
                        free(temp_app_id);
                return -1; // MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[Dbus DEBUG] Success to Send preprocessing assistant information : %s", app_id);
+               MAS_LOGI("[Dbus DEBUG] Success to Send preprocessing assistant information : %d %s", pid, app_id);
                dbus_connection_flush(g_conn_sender);
        }
 
@@ -388,7 +388,7 @@ int masc_dbus_send_streaming_section_changed(int pid, int section)
                MAS_LOGE("[Dbus ERROR] Fail to Send");
                return -1; // MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[Dbus DEBUG] Success to Send streaming section changed information : %d", section);
+               MAS_LOGI("[Dbus DEBUG] Success to Send streaming section changed information : %d %d", pid, section);
                dbus_connection_flush(g_conn_sender);
        }
 
@@ -442,7 +442,7 @@ int masc_dbus_send_preprocessing_result(int pid, bool result)
                MAS_LOGE("[Dbus ERROR] Fail to Send");
                return -1; // MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[Dbus DEBUG] Success to Send preprocessing result : %d", temp_result);
+               MAS_LOGI("[Dbus DEBUG] Success to Send preprocessing result : %d %d", pid, temp_result);
                dbus_connection_flush(g_conn_sender);
        }
 
@@ -504,7 +504,7 @@ int masc_dbus_send_wakeup_engine_command(int pid, const char* command)
                        free(temp_command);
                return -1; // MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[Dbus DEBUG] Success to Send wakeup_engine_command : %s", command);
+               MAS_LOGI("[Dbus DEBUG] Success to Send wakeup_engine_command : %d %s", pid, command);
                dbus_connection_flush(g_conn_sender);
        }
 
@@ -559,7 +559,7 @@ int masc_dbus_service_state_change(int pid, int state)
                MAS_LOGE("[Dbus ERROR] Fail to Send");
                return -1; // MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[Dbus DEBUG] Success to Send activate message : %d", state);
+               MAS_LOGI("[Dbus DEBUG] Success to Send activate message : %d %d", pid, state);
                dbus_connection_flush(g_conn_sender);
        }
 
index c229817937487d01c662afd804f79a5429f6ce9e..136606b1f26dafb29f993d0095aeeb61375acb3e 100644 (file)
@@ -69,7 +69,7 @@ int ma_service_dbus_initialize(DBusConnection* conn, DBusMessage* msg)
        DBusMessage* reply;
        reply = dbus_message_new_method_return(msg);
 
-       MAS_LOGD("[OUT] mas initialize : result(%d)", ret);
+       MAS_LOGI("[OUT] mas initialize : result(%d)", ret);
        if (NULL != reply) {
                dbus_message_append_args(reply,
                        DBUS_TYPE_INT32, &ret,
@@ -120,7 +120,7 @@ int ma_service_dbus_deinitialize(DBusConnection* conn, DBusMessage* msg)
        DBusMessage* reply;
        reply = dbus_message_new_method_return(msg);
 
-       MAS_LOGD("[OUT] mas deinitialize : result(%d)", ret);
+       MAS_LOGI("[OUT] mas deinitialize : result(%d)", ret);
        if (NULL != reply) {
                dbus_message_append_args(reply,
                        DBUS_TYPE_INT32, &ret,
@@ -165,7 +165,7 @@ int ma_service_dbus_get_audio_format(DBusConnection* conn, DBusMessage* msg)
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas get default voice");
+               MAS_LOGD("[IN] mas get audio format");
                ret = mas_client_get_audio_format(pid, &rate, &channel, &audio_type);
        }
 
@@ -181,7 +181,7 @@ int ma_service_dbus_get_audio_format(DBusConnection* conn, DBusMessage* msg)
                        DBUS_TYPE_INT32, &audio_type,
                        DBUS_TYPE_INVALID);
                if (0 == ret) {
-                       MAS_LOGD("[OUT] mas get audio format : rate(%d), channel(%d), audio_type(%d)", rate, channel, audio_type);
+                       MAS_LOGI("[OUT] mas get audio format : rate(%d), channel(%d), audio_type(%d)", rate, channel, audio_type);
                } else {
                        MAS_LOGE("[OUT ERROR] mas get audio format : result(%d)", ret);
                }
@@ -219,7 +219,7 @@ int ma_service_dbus_get_audio_source_type(DBusConnection* conn, DBusMessage* msg
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas get default voice");
+               MAS_LOGD("[IN] mas get audio source type");
                ret = mas_client_get_audio_source_type(pid, &type);
        }
 
@@ -240,7 +240,7 @@ int ma_service_dbus_get_audio_source_type(DBusConnection* conn, DBusMessage* msg
                        DBUS_TYPE_STRING, &temp_type,
                        DBUS_TYPE_INVALID);
                if (0 == ret) {
-                       MAS_LOGD("[OUT] mas get audio source type : type(%s)", temp_type);
+                       MAS_LOGI("[OUT] mas get audio source type : type(%s)", temp_type);
                } else {
                        MAS_LOGE("[OUT ERROR] mas get audio source type : result(%d)", ret);
                }
@@ -283,7 +283,7 @@ int ma_service_dbus_send_asr_result(DBusConnection* conn, DBusMessage* msg)
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas send asr result : pid(%d), event(%d), asr_result(%s)", pid, event, asr_result);
+               MAS_LOGI("[IN] mas send asr result : pid(%d), event(%d), asr_result(%s)", pid, event, asr_result);
                ret = mas_client_send_asr_result(pid, event, asr_result);
        }
 
@@ -342,7 +342,7 @@ int ma_service_dbus_send_result(DBusConnection* conn, DBusMessage* msg)
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas send result : pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json);
+               MAS_LOGI("[IN] mas send result : pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json);
                ret =  mas_client_send_result(pid, display_text, utterance_text, result_json);
        }
 
@@ -393,11 +393,11 @@ int ma_service_dbus_send_recognition_result(DBusConnection* conn, DBusMessage* m
        MAS_LOGD("[DEBUG] MAS SEND RECOGNITION RESULT");
 
        if (dbus_error_is_set(&err)) {
-               MAS_LOGE("[IN ERROR] mas send error : Get arguments error (%s)", err.message);
+               MAS_LOGE("[IN ERROR] mas send recognition result : Get arguments error (%s)", err.message);
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas send error : pid(%d), result(%d)", pid, result);
+               MAS_LOGI("[IN] mas send recognition result : pid(%d), result(%d)", pid, result);
                ret =  mas_client_send_recognition_result(pid, result);
        }
 
@@ -428,7 +428,7 @@ int ma_service_dbus_start_streaming_audio_data(DBusConnection* conn, DBusMessage
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas send start streaming : pid(%d), type(%d)", pid, type);
+               MAS_LOGI("[IN] mas send start streaming : pid(%d), type(%d)", pid, type);
                ret =  mas_client_start_streaming_audio_data(pid, type);
        }
 
@@ -459,7 +459,7 @@ int ma_service_dbus_stop_streaming_audio_data(DBusConnection* conn, DBusMessage*
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas stop streaming : pid(%d), type(%d)", pid, type);
+               MAS_LOGI("[IN] mas stop streaming : pid(%d), type(%d)", pid, type);
                ret =  mas_client_stop_streaming_audio_data(pid, type);
        }
 
@@ -490,7 +490,7 @@ int ma_service_dbus_update_voice_feedback_state(DBusConnection* conn, DBusMessag
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas update voice feedback : pid(%d), state(%d)", pid, state);
+               MAS_LOGI("[IN] mas update voice feedback : pid(%d), state(%d)", pid, state);
                ret =  mas_client_update_voice_feedback_state(pid, state);
        }
 
@@ -521,7 +521,7 @@ int ma_service_dbus_send_assistant_specific_command(DBusConnection* conn, DBusMe
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas send assistant specific command : pid(%d), command(%s)", pid, command);
+               MAS_LOGI("[IN] mas send assistant specific command : pid(%d), command(%s)", pid, command);
                ret =  mas_client_set_assistant_specific_command(pid, command);
        }
 
@@ -552,7 +552,7 @@ int ma_service_dbus_set_background_volume(DBusConnection* conn, DBusMessage* msg
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas set background volume : pid(%d), ratio(%f)", pid, ratio);
+               MAS_LOGI("[IN] mas set background volume : pid(%d), ratio(%f)", pid, ratio);
                ret =  mas_client_set_background_volume(pid, ratio);
        }
 
@@ -589,7 +589,7 @@ int ma_service_dbus_set_preprocessing_allow_mode(DBusConnection* conn, DBusMessa
                if (NULL != app_id && strcmp("#NULL", app_id)) {
                        temp_app_id = strdup(app_id);
                }
-               MAS_LOGD("[IN] mas set preprocessing allow mode : pid(%d), mode(%d), app_id(%s)", pid, mode, temp_app_id);
+               MAS_LOGI("[IN] mas set preprocessing allow mode : pid(%d), mode(%d), app_id(%s)", pid, mode, temp_app_id);
                ret =  mas_client_set_preprocessing_allow_mode(pid, mode, temp_app_id);
                if (NULL != temp_app_id)
                        free(temp_app_id);
@@ -622,7 +622,7 @@ int ma_service_dbus_send_preprocessing_result(DBusConnection* conn, DBusMessage*
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas send preprocessing result : pid(%d), result(%d)", pid, result);
+               MAS_LOGI("[IN] mas send preprocessing result : pid(%d), result(%d)", pid, result);
                ret =  mas_client_send_preprocessing_result(pid, (bool)result);
        }
 
@@ -653,7 +653,7 @@ int ma_service_dbus_set_wake_word_audio_require_flag(DBusConnection* conn, DBusM
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas set wake word audio require flag : pid(%d), require(%d)", pid, require);
+               MAS_LOGI("[IN] mas set wake word audio require flag : pid(%d), require(%d)", pid, require);
                ret =  mas_client_set_wake_word_audio_require_flag(pid, (bool)require);
        }
 
@@ -684,7 +684,7 @@ int ma_service_dbus_set_assistant_language(DBusConnection* conn, DBusMessage* ms
                dbus_error_free(&err);
                ret = -1; //MAS_ERROR_OPERATION_FAILED;
        } else {
-               MAS_LOGD("[IN] mas set assistant language : pid(%d), language(%s)", pid, language);
+               MAS_LOGI("[IN] mas set assistant language : pid(%d), language(%s)", pid, language);
                ret =  mas_client_set_assistant_language(pid, language);
        }