Delete meaningless configuration
[platform/core/uifw/tts.git] / server / ttsd_config.c
index d21ae3a..58dc2fa 100644 (file)
@@ -28,17 +28,17 @@ void __ttsd_config_engine_changed_cb(const char* engine_id, const char* setting,
 {
        /* Need to check engine is valid */
        if (false == tts_config_check_default_engine_is_valid(engine_id)) {
-               SLOG(LOG_ERROR, get_tag(), "Engine id is NOT valid : %s", engine_id);
+               SLOG(LOG_ERROR, tts_tag(), "Engine id is NOT valid : %s", engine_id);
                return;
        }
 
        if (NULL != g_callback) {
-               SECURE_SLOG(LOG_DEBUG, get_tag(), "Call the engine reload callback : engine id(%s)", engine_id);
+               SECURE_SLOG(LOG_DEBUG, tts_tag(), "Call the engine reload callback : engine id(%s)", engine_id);
                g_callback(TTS_CONFIG_TYPE_ENGINE, engine_id, 0);
-               SECURE_SLOG(LOG_DEBUG, get_tag(), "Call the voice changed callback : lang(%s), type(%d)", language, voice_type);
+               SECURE_SLOG(LOG_DEBUG, tts_tag(), "Call the voice changed callback : lang(%s), type(%d)", language, voice_type);
                g_callback(TTS_CONFIG_TYPE_VOICE, language, voice_type);
        } else {
-               SLOG(LOG_ERROR, get_tag(), "Config changed callback is NULL");
+               SLOG(LOG_ERROR, tts_tag(), "Config changed callback is NULL");
        }
 }
 
@@ -46,14 +46,14 @@ void __ttsd_config_voice_changed_cb(const char* before_language, int before_type
 {
        /* Need to check voice is valid */
        if (false == tts_config_check_default_voice_is_valid(language, type)) {
-               SLOG(LOG_ERROR, get_tag(), "Lang(%s) type(%d) is NOT valid : %s", language, type);
+               SLOG(LOG_ERROR, tts_tag(), "Lang(%s) type(%d) is NOT valid", language, type);
                return;
        }
 
        if (NULL != g_callback) {
                g_callback(TTS_CONFIG_TYPE_VOICE, language, type);
        } else {
-               SLOG(LOG_ERROR, get_tag(), "Config changed callback is NULL");
+               SLOG(LOG_ERROR, tts_tag(), "Config changed callback is NULL");
        }
 }
 
@@ -62,7 +62,7 @@ void __ttsd_config_speech_rate_changed_cb(int value, void* user_data)
        if (NULL != g_callback) {
                g_callback(TTS_CONFIG_TYPE_SPEED, NULL, value);
        } else {
-               SLOG(LOG_ERROR, get_tag(), "Config changed callback is NULL");
+               SLOG(LOG_ERROR, tts_tag(), "Config changed callback is NULL");
        }
 }
 
@@ -71,7 +71,7 @@ void __ttsd_config_pitch_changed_cb(int value, void* user_data)
        if (NULL != g_callback) {
                g_callback(TTS_CONFIG_TYPE_PITCH, NULL, value);
        } else {
-               SLOG(LOG_ERROR, get_tag(), "Config changed callback is NULL");
+               SLOG(LOG_ERROR, tts_tag(), "Config changed callback is NULL");
        }
 }
 
@@ -85,7 +85,7 @@ void __ttsd_config_screen_reader_changed_cb(bool value)
 int ttsd_config_initialize(ttsd_config_changed_cb config_cb)
 {
        if (NULL == config_cb) {
-               SLOG(LOG_ERROR, get_tag(), "[Config] Invalid parameter");
+               SLOG(LOG_ERROR, tts_tag(), "[Config] Invalid parameter");
                return -1;
        }
 
@@ -95,14 +95,14 @@ int ttsd_config_initialize(ttsd_config_changed_cb config_cb)
        int ret = -1;
        ret = tts_config_mgr_initialize(getpid());
        if (0 != ret) {
-               SLOG(LOG_ERROR, get_tag(), "[Config] Fail to initialize config manager");
+               SLOG(LOG_ERROR, tts_tag(), "[Config] Fail to initialize config manager");
                return -1;
        }
 
        ret = tts_config_mgr_set_callback(getpid(), __ttsd_config_engine_changed_cb, __ttsd_config_voice_changed_cb, 
                __ttsd_config_speech_rate_changed_cb, __ttsd_config_pitch_changed_cb, NULL);
        if (0 != ret) {
-               SLOG(LOG_ERROR, get_tag(), "[ERROR] Fail to set config changed : %d", ret);
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to set config changed : %d", ret);
                return -1;
        }
 
@@ -121,7 +121,7 @@ int ttsd_config_finalize()
 int ttsd_config_set_screen_reader_callback(ttsd_config_screen_reader_changed_cb sr_cb)
 {
        if (NULL == sr_cb) {
-               SLOG(LOG_ERROR, get_tag(), "[Config] Invalid parameter");
+               SLOG(LOG_ERROR, tts_tag(), "[Config] Invalid parameter");
                return -1;
        }
 
@@ -129,7 +129,7 @@ int ttsd_config_set_screen_reader_callback(ttsd_config_screen_reader_changed_cb
 
        int ret = tts_config_set_screen_reader_callback(getpid(), __ttsd_config_screen_reader_changed_cb) ;
        if (0 != ret) {
-               SLOG(LOG_ERROR, get_tag(), "[Config] Fail to set screen reader callback");
+               SLOG(LOG_ERROR, tts_tag(), "[Config] Fail to set screen reader callback");
                return -1;
        }
        return 0;
@@ -141,7 +141,7 @@ int ttsd_config_get_default_engine(char** engine_id)
                return -1;
 
        if (0 != tts_config_mgr_get_engine(engine_id)) {
-               SLOG(LOG_ERROR, get_tag(), "[Config ERROR] Fail to get engine id");
+               SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to get engine id");
                return TTSD_ERROR_OPERATION_FAILED;
        }
 
@@ -155,7 +155,7 @@ int ttsd_config_set_default_engine(const char* engine_id)
 
        if (true == tts_config_check_default_engine_is_valid(engine_id)) {
                if (0 != tts_config_mgr_set_engine(engine_id)) {
-                       SLOG(LOG_ERROR, get_tag(), "[Config ERROR] Fail to set engine id");
+                       SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to set engine id");
                }
        }
 
@@ -168,7 +168,7 @@ int ttsd_config_get_default_voice(char** language, int* type)
                return -1;
 
        if (0 != tts_config_mgr_get_voice(language, type)) {
-               SLOG(LOG_ERROR, get_tag(), "[Config ERROR] Fail to get default voice");
+               SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to get default voice");
                return TTSD_ERROR_OPERATION_FAILED;
        }
 
@@ -181,7 +181,7 @@ int ttsd_config_get_default_speed(int* speed)
                return -1;
 
        if (0 != tts_config_mgr_get_speech_rate(speed)) {
-               SLOG(LOG_ERROR, get_tag(), "[Config ERROR] Fail to get default speech rate");
+               SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to get default speech rate");
                return TTSD_ERROR_OPERATION_FAILED;
        }
 
@@ -194,7 +194,7 @@ int ttsd_config_get_default_pitch(int* pitch)
                return -1;
 
        if (0 != tts_config_mgr_get_pitch(pitch)) {
-               SLOG(LOG_ERROR, get_tag(), "[Config ERROR] Fail to get default pitch");
+               SLOG(LOG_ERROR, tts_tag(), "[Config ERROR] Fail to get default pitch");
                return TTSD_ERROR_OPERATION_FAILED;
        }
 
@@ -204,16 +204,17 @@ int ttsd_config_get_default_pitch(int* pitch)
 int ttsd_config_save_error(int uid, int uttid, const char* lang, int vctype, const char* text, 
                           const char* func, int line, const char* message)
 {
-       SLOG(LOG_ERROR, get_tag(), "=============== TTS ERROR LOG ====================");
+       SLOG(LOG_DEBUG, tts_tag(), "@@@@@ TTS ERROR LOG @@@@@");
 
-       SLOG(LOG_ERROR, get_tag(), "uid(%d) uttid(%d)", uid, uttid);
-       
-       if (NULL != func)       SLOG(LOG_ERROR, get_tag(), "Function(%s) Line(%d)", func, line);
-       if (NULL != message)    SLOG(LOG_ERROR, get_tag(), "Message(%s)", message);
-       if (NULL != lang)       SLOG(LOG_ERROR, get_tag(), "Lang(%s), type(%d)", lang, vctype);
-       if (NULL != text)       SLOG(LOG_ERROR, get_tag(), "Text(%s)", text);
+       SLOG(LOG_DEBUG, tts_tag(), "uid(%d) uttid(%d)", uid, uttid);
 
-       SLOG(LOG_ERROR, get_tag(), "==================================================");
+
+       SLOG(LOG_DEBUG, tts_tag(), "Function(%s) Line(%d)", (NULL == func) ? "NULL" : func, line);
+       SLOG(LOG_DEBUG, tts_tag(), "Message(%s)", (NULL == message) ? "NULL" : message);
+       SLOG(LOG_DEBUG, tts_tag(), "Lang(%s), type(%d)", (NULL == lang) ? "NULL" : lang, vctype);
+       SLOG(LOG_DEBUG, tts_tag(), "Text(%s)", (NULL == text) ? "NULL" : text);
+
+       SLOG(LOG_DEBUG, tts_tag(), "@@@@@");
 
        return 0;
-}
\ No newline at end of file
+}