From 53ddca3d6699a8192014977fb82829f9218c8f1e Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Mon, 14 Jan 2019 19:27:21 +0900 Subject: [PATCH] Add and update info logs Change-Id: Ibdb56797264b217947a57c040a0c74c66dda427c Signed-off-by: Wonnam Jang --- client/stt.c | 165 +++++++++++++++++++++++++++++++-------------------- server/sttd_server.c | 18 ++++++ 2 files changed, 118 insertions(+), 65 deletions(-) diff --git a/client/stt.c b/client/stt.c index 649a71a..beb0d18 100644 --- a/client/stt.c +++ b/client/stt.c @@ -319,6 +319,7 @@ void __stt_config_engine_changed_cb(const char* engine_id, const char* setting, if (NULL == client->current_engine_id) { if (STT_STATE_RECORDING == client->current_state || STT_STATE_PROCESSING == client->current_state) { + SLOG(LOG_INFO, TAG_STTC, "[INFO] stt cancel is invoked by engine_changed_cb, state(%d)", client->current_state); ret = stt_cancel(stt); if (0 != ret) { SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] STT client cancelling..."); @@ -375,7 +376,7 @@ int stt_create(stt_h* stt) return STT_ERROR_PERMISSION_DENIED; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Create STT"); + SLOG(LOG_INFO, TAG_STTC, "===== Create STT"); if (NULL == stt) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] A handle is null"); @@ -421,7 +422,7 @@ int stt_create(stt_h* stt) return ret; } - SLOG(LOG_DEBUG, TAG_STTC, "[Success] uid(%d)", (*stt)->handle); + SLOG(LOG_INFO, TAG_STTC, "[Success] uid(%d)", (*stt)->handle); SLOG(LOG_DEBUG, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); @@ -442,7 +443,7 @@ int stt_destroy(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Destroy STT"); + SLOG(LOG_INFO, TAG_STTC, "===== Destroy STT"); /* check used callback */ if (0 != stt_client_get_use_callback(client)) { @@ -485,7 +486,7 @@ int stt_destroy(stt_h stt) stt = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return STT_ERROR_NONE; @@ -527,7 +528,7 @@ int stt_foreach_supported_engines(stt_h stt, stt_supported_engine_cb callback, v return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Foreach Supported engine"); + SLOG(LOG_INFO, TAG_STTC, "===== Foreach Supported engine"); if (NULL == callback) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -552,7 +553,7 @@ int stt_foreach_supported_engines(stt_h stt, stt_supported_engine_cb callback, v client->supported_engine_cb = NULL; client->supported_engine_user_data = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -571,7 +572,7 @@ int stt_get_engine(stt_h stt, char** engine_id) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Get current engine"); + SLOG(LOG_INFO, TAG_STTC, "===== Get current engine"); if (NULL == engine_id) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -599,7 +600,7 @@ int stt_get_engine(stt_h stt, char** engine_id) } } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -682,7 +683,7 @@ int stt_set_engine(stt_h stt, const char* engine_id) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Set current engine"); + SLOG(LOG_INFO, TAG_STTC, "===== Set current engine"); if (NULL == engine_id) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -700,7 +701,7 @@ int stt_set_engine(stt_h stt, const char* engine_id) client->current_engine_id = NULL; } - SLOG(LOG_DEBUG, TAG_STTC, "===== engined_id(%s)", engine_id); + SLOG(LOG_INFO, TAG_STTC, "===== engined_id(%s)", engine_id); client->current_engine_id = strdup(engine_id); @@ -711,7 +712,7 @@ int stt_set_engine(stt_h stt, const char* engine_id) return ret; } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return 0; @@ -730,7 +731,7 @@ int stt_set_credential(stt_h stt, const char* credential) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Set credential"); + SLOG(LOG_INFO, TAG_STTC, "===== Set credential"); if (NULL == credential) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); @@ -749,7 +750,7 @@ int stt_set_credential(stt_h stt, const char* credential) } client->credential = strdup(credential); - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return STT_ERROR_NONE; @@ -768,7 +769,7 @@ int stt_set_private_data(stt_h stt, const char* key, const char* data) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Set private data"); + SLOG(LOG_INFO, TAG_STTC, "===== Set private data"); if (NULL == key || NULL == data) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid parameter"); @@ -808,7 +809,7 @@ int stt_set_private_data(stt_h stt, const char* key, const char* data) } } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, ""); return STT_ERROR_NONE; @@ -827,7 +828,7 @@ int stt_get_private_data(stt_h stt, const char* key, char** data) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Get private data"); + SLOG(LOG_INFO, TAG_STTC, "===== Get private data"); if (NULL == key || NULL == data) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid parameter"); @@ -867,7 +868,7 @@ int stt_get_private_data(stt_h stt, const char* key, char** data) *data = NULL; } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, ""); return STT_ERROR_NONE; @@ -889,7 +890,7 @@ int stt_set_server_stt(stt_h stt, const char* key, char* user_data) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Set STT server"); + SLOG(LOG_INFO, TAG_STTC, "===== Set STT server"); if (NULL == key || NULL == user_data) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid parameter"); @@ -930,7 +931,7 @@ int stt_set_server_stt(stt_h stt, const char* key, char* user_data) free(private_key); private_key = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "======"); + SLOG(LOG_INFO, TAG_STTC, "======"); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -977,7 +978,7 @@ static Eina_Bool __stt_connect_daemon(void *data) } g_connect_timer = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "===== Connect stt-service"); + SLOG(LOG_INFO, TAG_STTC, "===== Connect stt-service"); /* request initialization */ bool silence_supported = false; @@ -1038,7 +1039,7 @@ static Eina_Bool __stt_connect_daemon(void *data) } #endif //LCOV_EXCL_STOP - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] uid(%d)", client->uid); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] uid(%d)", client->uid); client->before_state = client->current_state; client->current_state = STT_STATE_READY; @@ -1053,7 +1054,7 @@ static Eina_Bool __stt_connect_daemon(void *data) SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null"); } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return EINA_FALSE; @@ -1072,6 +1073,8 @@ int stt_prepare(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } + SLOG(LOG_INFO, TAG_STTC, "===== Prepare STT"); + /* check state */ if (client->current_state != STT_STATE_CREATED) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State: Current state(%d) is not 'CREATED'", client->current_state); @@ -1082,7 +1085,7 @@ int stt_prepare(stt_h stt) g_connect_timer = ecore_timer_add(0.02, __stt_connect_daemon, (void*)client); ecore_thread_main_loop_end(); - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return STT_ERROR_NONE; @@ -1101,7 +1104,7 @@ int stt_unprepare(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Unprepare STT"); + SLOG(LOG_INFO, TAG_STTC, "===== Unprepare STT"); /* check state */ if (client->current_state != STT_STATE_READY) { @@ -1150,7 +1153,7 @@ int stt_unprepare(stt_h stt) g_connect_timer = NULL; } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return STT_ERROR_NONE; @@ -1166,6 +1169,8 @@ bool __stt_config_supported_language_cb(const char* engine_id, const char* langu return false; } + SLOG(LOG_INFO, TAG_STTC, "===== supported language callback"); + /* call callback function */ if (NULL != client->supported_lang_cb) { return client->supported_lang_cb(stt, language, client->supported_lang_user_data); @@ -1189,7 +1194,7 @@ int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callbac return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Foreach Supported Language"); + SLOG(LOG_INFO, TAG_STTC, "===== Foreach Supported Language"); if (NULL == callback) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -1233,7 +1238,7 @@ int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callbac client->supported_lang_cb = NULL; client->supported_lang_user_data = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -1252,7 +1257,7 @@ int stt_get_default_language(stt_h stt, char** language) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== Get Default Language"); + SLOG(LOG_INFO, TAG_STTC, "===== Get Default Language"); if (NULL == language) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -1268,7 +1273,7 @@ int stt_get_default_language(stt_h stt, char** language) SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Current language = %s", *language); } - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -1294,6 +1299,8 @@ int stt_get_state(stt_h stt, stt_state_e* state) *state = client->current_state; + SLOG(LOG_INFO, TAG_STTC, "===== Get state(%d)", *state); + switch (*state) { case STT_STATE_CREATED: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'CREATED'"); break; case STT_STATE_READY: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Ready'"); break; @@ -1330,12 +1337,12 @@ int stt_get_error_message(stt_h stt, char** err_msg) if (NULL != client->err_msg) { *err_msg = strdup(client->err_msg); - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Error msg (%s)", *err_msg); //LCOV_EXCL_LINE + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Error msg (%s)", *err_msg); //LCOV_EXCL_LINE } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Error msg (NULL)"); //LCOV_EXCL_LINE + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Error msg (NULL)"); //LCOV_EXCL_LINE } - SLOG(LOG_DEBUG, TAG_STTC, "====="); //LCOV_EXCL_LINE + SLOG(LOG_INFO, TAG_STTC, "====="); //LCOV_EXCL_LINE SLOG(LOG_DEBUG, TAG_STTC, " "); //LCOV_EXCL_LINE return STT_ERROR_NONE; @@ -1385,7 +1392,7 @@ int stt_is_recognition_type_supported(stt_h stt, const char* type, bool* support } //LCOV_EXCL_STOP } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] recognition type is %s", *support ? "true " : "false"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] recognition type is %s", *support ? "true " : "false"); break; } } @@ -1412,6 +1419,8 @@ int stt_set_silence_detection(stt_h stt, stt_option_silence_detection_e type) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "===== Set silence detection, supported(%d), type(%d)", client->silence_supported, type); + if (true == client->silence_supported) { if (type >= STT_OPTION_SILENCE_DETECTION_FALSE && type <= STT_OPTION_SILENCE_DETECTION_AUTO) { client->silence = type; @@ -1439,7 +1448,7 @@ int stt_set_start_sound(stt_h stt, const char* filename) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT SET START SOUND"); + SLOG(LOG_INFO, TAG_STTC, "===== STT SET START SOUND"); if (NULL == filename) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -1477,7 +1486,7 @@ int stt_set_start_sound(stt_h stt, const char* filename) } //LCOV_EXCL_STOP } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Set start sound : %s", filename); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Set start sound : %s", filename); break; } } @@ -1498,7 +1507,7 @@ int stt_unset_start_sound(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT UNSET START SOUND"); + SLOG(LOG_INFO, TAG_STTC, "===== STT UNSET START SOUND"); /* check state */ if (client->current_state != STT_STATE_READY) { @@ -1526,7 +1535,7 @@ int stt_unset_start_sound(stt_h stt) } //LCOV_EXCL_STOP } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Unset start sound"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Unset start sound"); break; } } @@ -1547,7 +1556,7 @@ int stt_set_stop_sound(stt_h stt, const char* filename) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT SET STOP SOUND"); + SLOG(LOG_INFO, TAG_STTC, "===== STT SET STOP SOUND"); if (NULL == filename) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -1585,7 +1594,7 @@ int stt_set_stop_sound(stt_h stt, const char* filename) } //LCOV_EXCL_STOP } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Set stop sound : %s", filename); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Set stop sound : %s", filename); break; } } @@ -1606,7 +1615,7 @@ int stt_unset_stop_sound(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT UNSET STOP SOUND"); + SLOG(LOG_INFO, TAG_STTC, "===== STT UNSET STOP SOUND"); /* check state */ if (client->current_state != STT_STATE_READY) { @@ -1634,7 +1643,7 @@ int stt_unset_stop_sound(stt_h stt) } //LCOV_EXCL_STOP } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Unset stop sound"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Unset stop sound"); break; } } @@ -1655,7 +1664,7 @@ int stt_start(stt_h stt, const char* language, const char* type) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT START"); + SLOG(LOG_INFO, TAG_STTC, "===== STT START"); /* check state */ if (client->current_state != STT_STATE_READY) { @@ -1703,13 +1712,13 @@ int stt_start(stt_h stt, const char* language, const char* type) SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to start : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE client->internal_state = STT_INTERNAL_STATE_NONE; } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Start is successful but not done"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Start is successful but not done"); } free(temp); temp = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -1728,7 +1737,7 @@ int stt_stop(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT STOP"); + SLOG(LOG_INFO, TAG_STTC, "===== STT STOP"); /* check state */ if (client->current_state != STT_STATE_RECORDING) { @@ -1753,7 +1762,7 @@ int stt_stop(stt_h stt) SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to stop : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE client->internal_state = STT_INTERNAL_STATE_NONE; } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Stop is successful but not done"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Stop is successful but not done"); } SLOG(LOG_DEBUG, TAG_STTC, "====="); @@ -1776,7 +1785,7 @@ int stt_cancel(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT CANCEL"); + SLOG(LOG_INFO, TAG_STTC, "===== STT CANCEL"); /* check state */ if (STT_STATE_RECORDING != client->current_state && STT_STATE_PROCESSING != client->current_state) { @@ -1801,7 +1810,7 @@ int stt_cancel(stt_h stt) SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to cancel : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE client->internal_state = STT_INTERNAL_STATE_NONE; } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Cancel is successful but not done"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Cancel is successful but not done"); } SLOG(LOG_DEBUG, TAG_STTC, "====="); @@ -1830,7 +1839,7 @@ int __stt_cb_set_volume(int uid, float volume) } g_volume_db = volume; - SLOG(LOG_DEBUG, TAG_STTC, "Set volume (%f)", g_volume_db); + SLOG(LOG_INFO, TAG_STTC, "Set volume (%f)", g_volume_db); return 0; } @@ -1860,6 +1869,8 @@ int stt_get_recording_volume(stt_h stt, float* volume) *volume = g_volume_db; + SLOG(LOG_INFO, TAG_STTC, "Get recording volume (%f)", *volume); + return STT_ERROR_NONE; } @@ -1875,7 +1886,7 @@ bool __stt_result_time_cb(int index, int event, const char* text, long start_tim } if (NULL != client->result_time_cb) { - SLOG(LOG_DEBUG, TAG_STTC, "(%d) event(%d) text(%s) start(%ld) end(%ld)", + SLOG(LOG_INFO, TAG_STTC, "(%d) event(%d) text(%s) start(%ld) end(%ld)", index, event, text, start_time, end_time); client->result_time_cb(client->stt, index, (stt_result_time_event_e)event, text, start_time, end_time, client->result_time_user_data); @@ -1901,7 +1912,7 @@ int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* us return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT FOREACH DETAILED RESULT"); + SLOG(LOG_INFO, TAG_STTC, "===== STT FOREACH DETAILED RESULT"); if (NULL == callback) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL"); //LCOV_EXCL_LINE @@ -1921,7 +1932,7 @@ int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* us client->result_time_cb = NULL; client->result_time_user_data = NULL; - SLOG(LOG_DEBUG, TAG_STTC, "====="); + SLOG(LOG_INFO, TAG_STTC, "====="); SLOG(LOG_DEBUG, TAG_STTC, " "); return ret; @@ -2057,13 +2068,13 @@ static void __stt_notify_state_changed(void *data) if (STT_INTERNAL_STATE_STARTING == client->internal_state && STT_STATE_RECORDING == client->current_state) { client->internal_state = STT_INTERNAL_STATE_NONE; - SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE"); + SLOG(LOG_INFO, TAG_STTC, "Internal state change to NONE"); } else if (STT_INTERNAL_STATE_STOPPING == client->internal_state && STT_STATE_PROCESSING == client->current_state) { client->internal_state = STT_INTERNAL_STATE_NONE; - SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE"); + SLOG(LOG_INFO, TAG_STTC, "Internal state change to NONE"); } else if (STT_INTERNAL_STATE_CANCELING == client->internal_state && STT_STATE_READY == client->current_state) { client->internal_state = STT_INTERNAL_STATE_NONE; - SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE"); + SLOG(LOG_INFO, TAG_STTC, "Internal state change to NONE"); } if (NULL != client->state_changed_cb) { @@ -2071,7 +2082,7 @@ static void __stt_notify_state_changed(void *data) client->state_changed_cb(client->stt, client->before_state, client->current_state, client->state_changed_user_data); stt_client_not_use_callback(client); - SLOG(LOG_DEBUG, TAG_STTC, "State changed callback is called, State(%d)", client->current_state); + SLOG(LOG_INFO, TAG_STTC, "State changed callback is called, State(%d)", client->current_state); } else { SLOG(LOG_WARN, TAG_STTC, "[WARNING] State changed callback is null, State(%d)", client->current_state); //LCOV_EXCL_LINE } @@ -2098,7 +2109,7 @@ static Eina_Bool __stt_notify_result(void *data) client->recognition_result_cb(client->stt, client->event, (const char**)client->data_list, client->data_count, client->msg, client->recognition_result_user_data); stt_client_not_use_callback(client); - SLOG(LOG_DEBUG, TAG_STTC, "client recognition result callback called"); + SLOG(LOG_INFO, TAG_STTC, "client recognition result callback called"); } else { SLOG(LOG_WARN, TAG_STTC, "[WARNING] User recognition result callback is NULL"); } @@ -2154,12 +2165,12 @@ int __stt_cb_result(int uid, int event, char** data, int data_count, const char* } if (NULL != msg) - SECURE_SLOG(LOG_DEBUG, TAG_STTC, "Recognition Result Message = %s", msg); + SECURE_SLOG(LOG_INFO, TAG_STTC, "Recognition Result Message = %s", msg); int i = 0; for (i = 0; i < data_count; i++) { if (NULL != data[i]) - SECURE_SLOG(LOG_DEBUG, TAG_STTC, "Recognition Result[%d] = %s", i, data[i]); + SECURE_SLOG(LOG_INFO, TAG_STTC, "Recognition Result[%d] = %s", i, data[i]); } if (NULL != client->recognition_result_cb) { @@ -2236,7 +2247,7 @@ static void __stt_notify_speech_status(void *data) stt_client_use_callback(client); client->speech_status_cb(client->stt, client->speech_status, client->speech_status_user_data); stt_client_not_use_callback(client); - SLOG(LOG_DEBUG, TAG_STTC, "Speech status callback is called"); //LCOV_EXCL_LINE + SLOG(LOG_INFO, TAG_STTC, "Speech status callback is called"); //LCOV_EXCL_LINE } else { SLOG(LOG_WARN, TAG_STTC, "[WARNING] Speech status callback is null"); //LCOV_EXCL_LINE } @@ -2279,6 +2290,8 @@ int stt_set_recognition_result_cb(stt_h stt, stt_recognition_result_cb callback, return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Set recognition result cb"); + client->recognition_result_cb = callback; client->recognition_result_user_data = user_data; @@ -2303,6 +2316,8 @@ int stt_unset_recognition_result_cb(stt_h stt) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset recognition result cb"); + client->recognition_result_cb = NULL; client->recognition_result_user_data = NULL; @@ -2330,6 +2345,8 @@ int stt_set_state_changed_cb(stt_h stt, stt_state_changed_cb callback, void* use return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Set state changed cb"); + client->state_changed_cb = callback; client->state_changed_user_data = user_data; @@ -2354,6 +2371,8 @@ int stt_unset_state_changed_cb(stt_h stt) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset state changed cb"); + client->state_changed_cb = NULL; client->state_changed_user_data = NULL; @@ -2381,6 +2400,8 @@ int stt_set_error_cb(stt_h stt, stt_error_cb callback, void* user_data) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Set error cb"); + client->error_cb = callback; client->error_user_data = user_data; @@ -2405,6 +2426,8 @@ int stt_unset_error_cb(stt_h stt) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset error cb"); + client->error_cb = NULL; client->error_user_data = NULL; @@ -2432,6 +2455,8 @@ int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_ return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Set default language changed cb"); + client->default_lang_changed_cb = callback; client->default_lang_changed_user_data = user_data; @@ -2456,6 +2481,8 @@ int stt_unset_default_language_changed_cb(stt_h stt) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset default language changed cb"); + client->default_lang_changed_cb = NULL; client->default_lang_changed_user_data = NULL; @@ -2483,6 +2510,8 @@ int stt_set_engine_changed_cb(stt_h stt, stt_engine_changed_cb callback, void* u return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Set engine changed cb"); + client->engine_changed_cb = callback; client->engine_changed_user_data = user_data; @@ -2507,6 +2536,8 @@ int stt_unset_engine_changed_cb(stt_h stt) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset engine changed cb"); + client->engine_changed_cb = NULL; client->engine_changed_user_data = NULL; @@ -2535,6 +2566,8 @@ int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* use return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Set speech status cb"); + client->speech_status_cb = callback; client->speech_status_user_data = user_data; @@ -2559,6 +2592,8 @@ int stt_unset_speech_status_cb(stt_h stt) return STT_ERROR_INVALID_STATE; } + SLOG(LOG_INFO, TAG_STTC, "[INFO] Unset speech status cb"); + client->speech_status_cb = NULL; client->speech_status_user_data = NULL; @@ -2582,7 +2617,7 @@ int stt_start_file(stt_h stt, const char* language, const char* type, const char return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT START FILE"); + SLOG(LOG_INFO, TAG_STTC, "===== STT START FILE"); /* check state */ if (client->current_state != STT_STATE_READY) { @@ -2602,7 +2637,7 @@ int stt_start_file(stt_h stt, const char* language, const char* type, const char if ((AUL_R_OK != ret) || (0 == strlen(appid))) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get application ID"); } else { - SLOG(LOG_DEBUG, TAG_STTC, "[DEBUG] Current app id is %s", appid); + SLOG(LOG_INFO, TAG_STTC, "[DEBUG] Current app id is %s", appid); } char* temp = NULL; @@ -2630,7 +2665,7 @@ int stt_start_file(stt_h stt, const char* language, const char* type, const char SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to start file : %s", __stt_get_error_code(ret)); client->internal_state = STT_INTERNAL_STATE_NONE; } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Start is successful but not done"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Start is successful but not done"); } free(temp); @@ -2655,7 +2690,7 @@ int stt_cancel_file(stt_h stt) return STT_ERROR_INVALID_PARAMETER; } - SLOG(LOG_DEBUG, TAG_STTC, "===== STT CANCEL FILE"); + SLOG(LOG_INFO, TAG_STTC, "===== STT CANCEL FILE"); /* check state */ if (STT_STATE_RECORDING != client->current_state && STT_STATE_PROCESSING != client->current_state) { @@ -2680,7 +2715,7 @@ int stt_cancel_file(stt_h stt) SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to cancel file : %s", __stt_get_error_code(ret)); client->internal_state = STT_INTERNAL_STATE_NONE; } else { - SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Cancel file is successful but not done"); + SLOG(LOG_INFO, TAG_STTC, "[SUCCESS] Cancel file is successful but not done"); } SLOG(LOG_DEBUG, TAG_STTC, "====="); diff --git a/server/sttd_server.c b/server/sttd_server.c index ebd6df0..c31d6a6 100644 --- a/server/sttd_server.c +++ b/server/sttd_server.c @@ -680,6 +680,8 @@ static Eina_Bool __quit_ecore_loop(void *data) int sttd_server_finalize(int uid) { + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] Enter Finalize"); + /* check if uid is valid */ app_state_e state; if (0 != sttd_client_get_state(uid, &state)) { @@ -703,6 +705,8 @@ int sttd_server_finalize(int uid) } } + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] stt_cancel is invoked while state is (%d)", state); + if (0 != sttd_engine_agent_recognize_cancel(uid)) { SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to cancel recognition"); } @@ -721,6 +725,8 @@ int sttd_server_finalize(int uid) ecore_timer_add(0, __quit_ecore_loop, NULL); } + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] End Finalize"); + return STTD_ERROR_NONE; } @@ -1285,10 +1291,14 @@ Eina_Bool __time_out_for_processing(void *data) g_processing_timer = NULL; } + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] Enter __time_out_for_processing"); + /* current uid */ int uid = stt_client_get_current_recognition(); if (0 == uid) return EINA_FALSE; + SLOG(LOG_INFO, TAG_STTD, "[Server Info] stt cancel is invoked by timeout for processing"); + /* Cancel engine */ int ret = sttd_engine_agent_recognize_cancel(); if (0 != ret) { @@ -1310,6 +1320,8 @@ Eina_Bool __time_out_for_processing(void *data) stt_client_unset_current_recognition(); + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] End __time_out_for_processing"); + return EINA_FALSE; } @@ -1457,6 +1469,8 @@ int sttd_server_stop(int uid) int sttd_server_cancel(int uid) { + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] Enter sttd_server_cancel"); + /* check if uid is valid */ app_state_e state; if (0 != sttd_client_get_state(uid, &state)) { @@ -1494,6 +1508,8 @@ int sttd_server_cancel(int uid) /* change uid state */ sttd_client_set_state(uid, APP_STATE_READY); + SLOG(LOG_INFO, TAG_STTD, "[Server Info] stt cancel is invoked by app's request"); + /* cancel engine recognition */ int ret = sttd_engine_agent_recognize_cancel(); if (0 != ret) { @@ -1504,6 +1520,8 @@ int sttd_server_cancel(int uid) /* Notify uid state change */ sttdc_send_set_state(uid, APP_STATE_READY); + SLOG(LOG_INFO, TAG_STTD, "[Server INFO] End sttd_server_cancel"); + return STTD_ERROR_NONE; } -- 2.7.4