Remove eprintf() 51/210151/2 tizen
authorKiseok Chang <kiso.chang@samsung.com>
Tue, 16 Jul 2019 06:28:45 +0000 (15:28 +0900)
committerKiseok Chang <kiso.chang@samsung.com>
Tue, 16 Jul 2019 07:45:19 +0000 (16:45 +0900)
- replace with SCTRACE_xxxxx

Change-Id: I819432a16a3567d69c8ab8556dfa51e301f48717
Signed-off-by: Kiseok Chang <kiso.chang@samsung.com>
18 files changed:
src/common/GenSettingMenu.cpp
src/common/SCDebug.h
src/common/SCReportMenu.cpp
src/common/SCUtil.cpp
src/common/SettingCommand.cpp
src/common/SettingMenu.cpp
src/main.cpp
src/settings/sc_aboutdevice.cpp
src/settings/sc_airplane.cpp
src/settings/sc_apps.cpp
src/settings/sc_battery.cpp
src/settings/sc_bluetooth.cpp
src/settings/sc_datausage.cpp
src/settings/sc_datetime.cpp
src/settings/sc_display.cpp
src/settings/sc_sound.cpp
src/settings/sc_storage.cpp
src/settings/sc_wifi.cpp

index 80119f2..d51d839 100644 (file)
@@ -27,7 +27,7 @@ GenSettingMenu::GenSettingMenu(const char * optstr, const char * namestr, SCFunc
 
 bool GenSettingMenu::create()
 {
-       eprintf("entered in GenSettingMenu::create() of %s\n", name());
+       SCTRACE_DEBUG("entered in GenSettingMenu::create() of %s", name());
        if(funcPrecreate)
                (*funcPrecreate)(this);
 
@@ -37,7 +37,7 @@ bool GenSettingMenu::create()
 
 MENURUN_ERROR GenSettingMenu::execute(string &title, int argc, char *argv[])
 {
-       eprintf("execute() of %s, %p, %p, %p\n", name(), funcExecute, funcPrecreate, funcValue);
+       SCTRACE_DEBUG("execute() of %s, %p, %p, %p", name(), funcExecute, funcPrecreate, funcValue);
        if (funcExecute) {
                printf("%s\n\n", title.c_str());
                return (*funcExecute)(argc, argv, this);
@@ -58,7 +58,7 @@ MENURUN_ERROR GenSettingMenu::execute(string &title, int argc, char *argv[])
 
 MENURUN_ERROR GenSettingMenu::value(string &resultstr, int argc, char *argv[])
 {
-       eprintf("value() of %s, %p, %p, %p\n", name(), funcExecute, funcPrecreate, funcValue);
+       SCTRACE_DEBUG("value() of %s, %p, %p, %p", name(), funcExecute, funcPrecreate, funcValue);
        if (funcValue) {
                return (*funcValue)(resultstr, argc, argv, this);
        }
index cb44069..5cde4c9 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __SCDEBUG_H_
 #define __SCDEBUG_H_
 
+#include <stdio.h>
+#include <string.h>
 #include <glib.h>
 
 #define SETTINGCMD_USING_PLATFORM_DBG
@@ -25,8 +27,6 @@
 #ifdef LOG_TAG
 #undef LOG_TAG
 #endif
-
-
 #define LOG_TAG "SETTINGCMD"
 #endif
 
 #ifdef SETTINGCMD_ENABLE_TRACE
 
 #ifdef SETTINGCMD_USING_PLATFORM_DBG
-#define SETTINGCMD_TRACE_SECURE_DEBUG(fmt, arg...) do {\
+#define SCTRACE_SECURE_DEBUG(fmt, arg...) do {\
                SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
 } while (0)
 
-#define SETTINGCMD_TRACE_DEBUG(fmt, arg...) do {\
+#define SCTRACE_DEBUG(fmt, arg...) do {\
                SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
 } while (0)
 
-#define SETTINGCMD_TRACE(fmt, arg...) do {\
+#define SCTRACE(fmt, arg...) do {\
                SECURE_LOGI("\033[0;36m" fmt "\033[0m\n", ##arg);\
 } while (0)
 
-#define SETTINGCMD_TRACE_WARNING(fmt, arg...) do {\
+#define SCTRACE_WARNING(fmt, arg...) do {\
                SECURE_LOGI("\033[0;33mWARRING: " fmt "\033[0m\n", ##arg);\
 } while (0)
 
-#define SETTINGCMD_TRACE_ERROR(fmt, arg...) do {\
+#define SCTRACE_ERROR(fmt, arg...) do {\
                SECURE_LOGE("\033[0;31mERROR: " fmt "\033[0m\n", ##arg);\
 } while (0)
 
-#define SETTINGCMD_TRACE_BEGIN do {\
+#define SCTRACE_BEGIN do {\
        SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", \
                        __FUNCTION__);\
 } while (0)
 
-#define SETTINGCMD_TRACE_END  do {\
+#define SCTRACE_END  do {\
                SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", \
                        __FUNCTION__);\
 } while (0)
 
 #else
 
-#define SETTINGCMD_TRACE(fmt, arg...) do {\
+#define SCTRACE(fmt, arg...) do {\
        printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
                        ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 } while (0)
 
-#define SETTINGCMD_TRACE_SECURE_DEBUG(fmt, arg...) do {\
+#define SCTRACE_SECURE_DEBUG(fmt, arg...) do {\
        printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
                        ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 } while (0)
 
 
-#define SETTINGCMD_TRACE_DEBUG(fmt, arg...) do {\
+#define SCTRACE_DEBUG(fmt, arg...) do {\
        printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
                        ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 } while (0)
 
-#define SETTINGCMD_TRACE_WARNING(fmt, arg...) do {\
+#define SCTRACE_WARNING(fmt, arg...) do {\
        printf("[SETTING]\033[0;33mWARRING: " fmt \
                        "\033[0m\t%s:%d\n", ##arg, \
                        (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 } while (0)
 
-#define SETTINGCMD_TRACE_ERROR(fmt, arg...) do {\
+#define SCTRACE_ERROR(fmt, arg...) do {\
        fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt \
                        "\033[0m\t%s:%d\n", ##arg, \
                        (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 } while (0)
 
-#define SETTINGCMD_TRACE_BEGIN do {\
+#define SCTRACE_BEGIN do {\
        printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
                                __FUNCTION__, \
                                (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 } while (0)
 
-#define SETTINGCMD_TRACE_END  do {\
+#define SCTRACE_END  do {\
        printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
                                __FUNCTION__, \
                                (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
 
 #else
 
-#define SETTINGCMD_TRACE(fmt, arg...) do {} while (0)
-#define SETTINGCMD_TRACE_SECURE_DEBUG(fmt, arg...) do {} while (0)
-#define SETTINGCMD_TRACE_DEBUG(fmt, arg...) do {} while (0)
-#define SETTINGCMD_TRACE_WARNING(fmt, arg...) do {} while (0)
-#define SETTINGCMD_TRACE_ERROR(fmt, arg...) do {} while (0)
-#define SETTINGCMD_TRACE_BEGIN do {} while (0)
-#define SETTINGCMD_TRACE_END do {} while (0)
+#define SCTRACE(fmt, arg...) do {} while (0)
+#define SCTRACE_SECURE_DEBUG(fmt, arg...) do {} while (0)
+#define SCTRACE_DEBUG(fmt, arg...) do {} while (0)
+#define SCTRACE_WARNING(fmt, arg...) do {} while (0)
+#define SCTRACE_ERROR(fmt, arg...) do {} while (0)
+#define SCTRACE_BEGIN do {} while (0)
+#define SCTRACE_END do {} while (0)
 
 #endif
 
 #define settingcmd_retvm_if(expr, val, fmt, arg...) do { \
        if (expr) { \
-               SETTINGCMD_TRACE_ERROR(fmt, ##arg); \
+               SCTRACE_ERROR(fmt, ##arg); \
                return (val); \
        } \
 } while (0)
 
 #define settingcmd_retm_if(expr, fmt, arg...) do { \
        if (expr) { \
-               SETTINGCMD_TRACE_ERROR(fmt, ##arg); \
+               SCTRACE_ERROR(fmt, ##arg); \
                return; \
        } \
 } while (0)
 #ifndef retv_if
 #define retv_if(expr, val) do { \
        if (expr) { \
-               SETTINGCMD_TRACE_ERROR("(%s)", #expr); \
+               SCTRACE_ERROR("(%s)", #expr); \
                return (val); \
        } \
 } while (0)
 #ifndef ret_if
 #define ret_if(expr) do { \
        if (expr) { \
-               SETTINGCMD_TRACE_ERROR("(%s)", #expr); \
+               SCTRACE_ERROR("(%s)", #expr); \
                return ; \
        } \
 } while (0)
 #ifndef warn_if
 #define warn_if(expr, fmt, arg...) do { \
        if (expr) { \
-               SETTINGCMD_TRACE_ERROR(fmt, ##arg); \
+               SCTRACE_ERROR(fmt, ##arg); \
        } \
 } while (0)
 #endif
 #define FREE(arg) __FREE(free, arg)
 #define G_FREE(arg) __FREE(g_free, arg)
 
-
-/////////////////////////////////////////////////////////////////////////////////////
-#include <stdio.h>
-
-//#define __SC_DEBUG__
-
-#ifdef __SC_DEBUG__
-#define eprintf(...) fprintf (stderr, __VA_ARGS__)
-#else
-#define eprintf(...) do {} while (0)
-#endif
-
 #endif /* __SCDEBUG_H_ */
index c619b60..3ec015a 100644 (file)
@@ -28,7 +28,7 @@ SCReportMenu::SCReportMenu()
 
 bool SCReportMenu::create()
 {
-
+       return true;
 }
 
 
@@ -38,25 +38,25 @@ static char reportTemplate[MAX_TEMPLATEBUFFER];
 MENURUN_ERROR SCReportMenu::execute(std::string &title, int argc, char *argv[])
 {
        if (argc < 1) {
-               eprintf("argc : %d\n", argc);
+               SCTRACE_DEBUG("argc : %d", argc);
                printf("Please give a path of file with report template\n   > setting-cmd report [ template file ]\n\n");
                return MENURUN_ERR_NORMAL;
        }
 
        FILE *pfile = fopen(argv[0], "rb");
        if (pfile == NULL) {
-               eprintf("fopen failed : %s !\n", argv[0]);
+        SCTRACE_ERROR("fopen failed : %s !", argv[0]);
                return MENURUN_ERR_NORMAL;
        }
        fseek(pfile, 0, SEEK_END);
        int fsize = ftell(pfile);
        fseek(pfile, 0, SEEK_SET);
 
-       eprintf("fsize : %d\n", fsize);
+       SCTRACE_DEBUG("fsize : %d", fsize);
 
        int numread = fread(reportTemplate, sizeof(char), fsize, pfile);
        if (numread != fsize) {
-               eprintf("numread != fsize : %d\n", numread);
+               SCTRACE_DEBUG("numread != fsize : %d", numread);
                fclose(pfile);
                return MENURUN_ERR_NORMAL;
        }
@@ -106,7 +106,7 @@ MENURUN_ERROR SCReportMenu::getReportString(string &reportStr, const string &tem
        GenSettingMenu mainMenu("setting-cmd", "Main Menu", nullptr, nullptr, MainMemu_Precreate);
 
        if (!mainMenu.create()) {
-               eprintf("Main Menu failed to create\n");
+               SCTRACE_DEBUG("Main Menu failed to create");
                return MENURUN_ERR_NORMAL;
        }
 
index c006b0b..c278848 100644 (file)
@@ -28,7 +28,7 @@ int getProfile() {
        int ret = system_info_get_platform_string("tizen.org/feature/profile", &profile_str);
 
        if (ret != SYSTEM_INFO_ERROR_NONE) {
-               eprintf("ERROR!! failed profile info from system info API \n");
+               SCTRACE_ERROR("ERROR!! failed profile info from system info API");
                if (profile_str)
                        free((void*)profile_str);
                return MOBILE_PROFILE; /* default value return */
@@ -37,7 +37,7 @@ int getProfile() {
        if (profile_str == nullptr)
                return MOBILE_PROFILE;
 
-       eprintf("Profile : %s\n", profile_str);
+       SCTRACE_DEBUG("Profile : %s", profile_str);
 
        if (!strcmp(profile_str, "mobile")) {
                profile = MOBILE_PROFILE;
index e34fd92..fc5501f 100644 (file)
@@ -23,7 +23,7 @@ using namespace std;
 
 SettingCommand::SettingCommand(string& execstr, string& commandstr)
 {
-       eprintf("Entered into SettingCommand()\n");
+       SCTRACE_DEBUG("Entered into SettingCommand()");
 
        string token = execstr;
        stringstream ss_exec(execstr);
@@ -31,12 +31,9 @@ SettingCommand::SettingCommand(string& execstr, string& commandstr)
        settingCommands.push_back(token);
 
        stringstream ss_cmd(commandstr);
-       eprintf("%s  %s (", execstr.c_str(), commandstr.c_str());
        while (getline(ss_cmd, token, '/')) {
-               eprintf(" %s", token.c_str());
                settingCommands.push_back(token);
        }
-       eprintf(")\n");
 
        curPos = 0;
 }
index d04d6b4..c0d8899 100644 (file)
@@ -27,7 +27,7 @@ using namespace std;
 
 bool SettingMenu::create()
 {
-       eprintf("entered in SettingMenu::create() of %s\n", name());
+       SCTRACE_DEBUG("entered in SettingMenu::create() of %s", name());
        for (auto it = subMenus.begin(); it != subMenus.end(); ++it) {
                if (!(*it)->create()) {
                        destroy();
@@ -50,20 +50,20 @@ void SettingMenu::destroy()
 
 MENURUN_ERROR SettingMenu::execute(string &title, int argc, char *argv[])
 {
-       eprintf("execute() of %s\n", name());
+       SCTRACE_DEBUG("execute() of %s", name());
        return MENURUN_ERR_NONE;
 }
 
 MENURUN_ERROR SettingMenu::value(string &resultstr, int argc, char *argv[])
 {
-       eprintf("value() of %s\n", name());
+       SCTRACE_DEBUG("value() of %s", name());
        resultstr = string("[N/A]");
        return MENURUN_ERR_NONE;
 }
 
 MENURUN_ERROR SettingMenu::run(SettingCommand &settingcmds, string &title, int argc, char *argv[])
 {
-       eprintf("run() of %s\n", name());
+       SCTRACE_DEBUG("run() of %s", name());
 
        title += string(" - ") + name();
        MENURUN_ERROR result = execute(title, argc, argv);
@@ -84,13 +84,13 @@ MENURUN_ERROR SettingMenu::run(SettingCommand &settingcmds, string &title, int a
                }
        );
        if (it == subMenus.end()) {
-               eprintf("%s is not a valid command.\n\n", curcmd.c_str());
+               SCTRACE_ERROR("%s is not a valid command.", curcmd.c_str());
                printUsage(settingcmds);
                settingcmds.prev();
                return MENURUN_ERR_ARG_INVAILD;
        }
 
-       eprintf("command %s is founded.\n", curcmd.c_str());
+       SCTRACE_DEBUG("command %s is founded.", curcmd.c_str());
 
        result = ((*it)->run)(settingcmds, title, argc, argv);
        settingcmds.prev();
@@ -99,7 +99,7 @@ MENURUN_ERROR SettingMenu::run(SettingCommand &settingcmds, string &title, int a
 
 MENURUN_ERROR SettingMenu::query(string &resultstr, SettingCommand &settingcmds, int argc, char *argv[])
 {
-       eprintf("query() of %s\n", name());
+       SCTRACE_DEBUG("query() of %s", name());
 
        if (subMenus.empty()) {
                MENURUN_ERROR result = value(resultstr, argc, argv);
@@ -118,12 +118,12 @@ MENURUN_ERROR SettingMenu::query(string &resultstr, SettingCommand &settingcmds,
        }
        );
        if (it == subMenus.end()) {
-               eprintf("%s is not a valid command.\n\n", curcmd.c_str());
+               SCTRACE_ERROR("%s is not a valid command.", curcmd.c_str());
                settingcmds.prev();
                return MENURUN_ERR_ARG_INVAILD;
        }
 
-       eprintf("command %s is founded.\n", curcmd.c_str());
+       SCTRACE_DEBUG("command %s is founded.", curcmd.c_str());
 
        MENURUN_ERROR result = ((*it)->query)(resultstr, settingcmds, argc, argv);
        settingcmds.prev();
@@ -155,22 +155,21 @@ void SettingMenu::printUsage(SettingCommand &settingcmds)
 
 void SettingMenu::printError(MENURUN_ERROR error)
 {
-       eprintf("[SettingMenu Error] ");
+       const char *errorheader = "[SettingMenu Error]";
        switch (error) {
        case MENURUN_ERR_NORMAL:
-               eprintf("Normal error");
+               SCTRACE_DEBUG("%s Normal error", errorheader);
                break;
        case MENURUN_ERR_ARG_SHORT:
-               eprintf("Lack of arguments");
+               SCTRACE_DEBUG("%s Lack of arguments",errorheader);
                break;
        case MENURUN_ERR_ARG_INVAILD:
-               eprintf("Invalid argument");
+               SCTRACE_DEBUG("%s Invalid argument", errorheader);
                break;
        case MENURUN_ERR_NOTIMPL:
-               eprintf("Not implemented");
+               SCTRACE_DEBUG("%s Not implemented", errorheader);
                break;
        default:
                break;
        }
-       eprintf("\n");
 }
index 227e64d..2a29f30 100644 (file)
@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
        mainMenu.subMenus.push_back(new SCReportMenu());
 
        if (!mainMenu.create()) {
-               eprintf("Main Menu failed to create\n");
+          SCTRACE_DEBUG("Main Menu failed to create");
                return 0;
        }
 
index dbcfb58..4c9e365 100644 (file)
@@ -59,7 +59,7 @@ using namespace std;
 static bool __get_phone_model_name(char *szStr, int nSize)
 {
        if (szStr == nullptr) {
-               eprintf("szStr parameter is nullptr\n");
+               SCTRACE_ERROR("szStr parameter is nullptr");
                return false;
        }
 
@@ -68,7 +68,7 @@ static bool __get_phone_model_name(char *szStr, int nSize)
                        "http://tizen.org/system/model_name", &value);
        if (ret != SYSTEM_INFO_ERROR_NONE) {
                FREE(value);
-               eprintf("fail to call system_info_get_platform_string");
+               SCTRACE_ERROR("fail to call system_info_get_platform_string");
                snprintf(szStr, nSize, "%s", "Unavailable");
                return false;
        }
@@ -87,7 +87,7 @@ static bool __get_phone_model_name(char *szStr, int nSize)
 static bool __get_sw_version(char *szStr, int nSize)
 {
        if (szStr == nullptr) {
-               eprintf("szStr parameter is nullptr\n");
+               SCTRACE_ERROR("szStr parameter is nullptr");
                return false;
        }
 
@@ -96,7 +96,7 @@ static bool __get_sw_version(char *szStr, int nSize)
                        "http://tizen.org/feature/platform.version", &version);
        if (ret != SYSTEM_INFO_ERROR_NONE) {
                FREE(version);
-               eprintf("fail to call system_info_get_platform_string");
+               SCTRACE_ERROR("fail to call system_info_get_platform_string");
                snprintf(szStr, nSize, "%s", "Unavailable");
                return false;
        }
@@ -124,7 +124,7 @@ static bool __stat_get_cpuinfo(char *szStr, int nSize)
                "http://tizen.org/system/platform.processor", &cpu_name);
        if (SYSTEM_INFO_ERROR_NONE != ret) {
                FREE(cpu_name);
-               eprintf("fail to call system_info_get_platform_string");
+               SCTRACE_ERROR("fail to call system_info_get_platform_string");
                snprintf(szStr, nSize, "%s", "Unavailable");
                return false;
        }
@@ -219,14 +219,14 @@ static bool _get_sim_phone_number(int sim_number, char *str, int str_size)
 {
        telephony_handle_list_s tel_h_list;
        if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_init failed");
+               SCTRACE_ERROR("telephony_init failed");
                return false;
        }
 
        if ((int)tel_h_list.count < sim_number-1) {
-               eprintf("\tThere is no SIM%d card\n", sim_number);
+               SCTRACE_ERROR("\tThere is no SIM%d card", sim_number);
                if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
+                       SCTRACE_ERROR("telephony_deinit failed");
                        return false;
                }
                return false;
@@ -235,9 +235,9 @@ static bool _get_sim_phone_number(int sim_number, char *str, int str_size)
        char *phone_num = nullptr;
        int ret = telephony_sim_get_subscriber_number(tel_h_list.handle[sim_number-1], &phone_num);
        if (ret != 0 || phone_num == nullptr) {
-               eprintf("\tThere is no SIM%d card, ret:%d phone_num addr:0x%x\n", sim_number, ret, (unsigned int)phone_num);
+               SCTRACE_ERROR("\tThere is no SIM%d card, ret:%d phone_num addr:0x%x", sim_number, ret, (unsigned int)phone_num);
                if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
+                       SCTRACE_ERROR("telephony_deinit failed");
                        return false;
                }
                return false;
@@ -246,7 +246,7 @@ static bool _get_sim_phone_number(int sim_number, char *str, int str_size)
        free(phone_num);
 
        if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_deinit failed");
+               SCTRACE_ERROR("telephony_deinit failed");
                return false;
        }
 
@@ -278,14 +278,14 @@ static bool _get_sim_ime(int sim_number, char * str, int str_size)
 {
        telephony_handle_list_s tel_h_list;
        if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_init failed");
+               SCTRACE_ERROR("telephony_init failed");
                return false;
        }
 
        if ((int)tel_h_list.count < sim_number-1) {
                printf("\tThere is no SIM%d card\n", sim_number);
                if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
+                       SCTRACE_ERROR("telephony_deinit failed");
                        return false;
                }
                return false;
@@ -296,7 +296,7 @@ static bool _get_sim_ime(int sim_number, char * str, int str_size)
        if (ret != 0 || ime_buffer == nullptr) {
                printf("\tThere is no SIM%d card, ret:%d ime_buffer addr:0x%x\n", sim_number, ret, (unsigned int)ime_buffer);
                if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
+                       SCTRACE_ERROR("telephony_deinit failed");
                        return false;
                }
                return false;
@@ -305,7 +305,7 @@ static bool _get_sim_ime(int sim_number, char * str, int str_size)
        free(ime_buffer);
 
        if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_deinit failed");
+               SCTRACE_ERROR("telephony_deinit failed");
                return false;
        }
 
@@ -346,7 +346,7 @@ static MENURUN_ERROR menugetstring_ad_bta(string &resultstr, int argc, char *arg
                        snprintf(errmsg, sizeof(errmsg), "Bluetooth is disabled!\n");
                else
                        snprintf(errmsg, sizeof(errmsg), "Bluetooth is unavailable!\n");
-               eprintf("Fail to get BT address, error code: %s\n", errmsg);
+               SCTRACE_ERROR("Fail to get BT address, error code: %s", errmsg);
                free(local_address);
                return MENURUN_ERR_NORMAL;
        }
@@ -374,7 +374,7 @@ static MENURUN_ERROR menugetstring_ad_wfa(string &resultstr, int argc, char *arg
        if (ret != WIFI_MANAGER_ERROR_NONE && mac_addr) {
                char errmsg[200];
                snprintf(errmsg, sizeof(errmsg), "WIFI is unavailable!\n");
-               eprintf("Fail to get WIFI address, error code: %s\n", errmsg);
+               SCTRACE_ERROR("Fail to get WIFI address, error code: %s", errmsg);
                return MENURUN_ERR_NORMAL;
        }
 
@@ -400,7 +400,7 @@ static MENURUN_ERROR menugetstring_ad_sto(string &resultstr, int argc, char *arg
        struct statvfs external;
 
        if (storage_get_internal_memory_size(&internal) < 0) {
-               eprintf("Fail to get internal memory size\n");
+               SCTRACE_ERROR("Fail to get internal memory size");
                return MENURUN_ERR_NORMAL;
        }
        total = (long long int)internal.f_frsize
@@ -409,7 +409,7 @@ static MENURUN_ERROR menugetstring_ad_sto(string &resultstr, int argc, char *arg
                * (long long int)internal.f_bavail;
 
        if (storage_get_external_memory_size(&external) < 0) {
-               eprintf("Fail to get external memory size\n");
+               SCTRACE_ERROR("Fail to get external memory size");
        }
        else {
                total += (long long int)external.f_frsize
@@ -420,7 +420,7 @@ static MENURUN_ERROR menugetstring_ad_sto(string &resultstr, int argc, char *arg
 
        /* check if values are appropriate*/
        if (total < 0 || avail < 0 || total < avail) {
-               eprintf("Fail to get internal memory size\n");
+               SCTRACE_ERROR("Fail to get internal memory size");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -440,14 +440,14 @@ static MENURUN_ERROR menugetstring_ad_batt(string &resultstr, int argc, char *ar
 
        int fd = open(file, O_RDONLY);
        if (fd == -1) {
-               eprintf("open file fail\n");
+               SCTRACE_ERROR("open file fail");
                return MENURUN_ERR_NORMAL;
        }
 
        char buf[MAX_DISPLAY_STR_LEN_ON_PHONE_INFO] = { '\0', };
        int r = read(fd, buf, MAX_DISPLAY_STR_LEN_ON_PHONE_INFO);
        if (r < 0 || r >= MAX_DISPLAY_STR_LEN_ON_PHONE_INFO) {
-               eprintf("read file fail\n");
+               SCTRACE_ERROR("read file fail");
                close(fd);
                return MENURUN_ERR_NORMAL;
        }
@@ -485,7 +485,7 @@ static int __stat_get_cpu_usage(float *usr_pct, float *sys_pct)
 
        FILE *fp = fopen(SETTING_ABOUT_STAT_PATH, "r");
        if (fp == nullptr) {
-               eprintf("fp == nullptr\n");
+               SCTRACE_ERROR("fp == nullptr");
                return -ENOENT;
        }
 
@@ -493,7 +493,7 @@ static int __stat_get_cpu_usage(float *usr_pct, float *sys_pct)
        char *cpu_info_p = fgets(cpu_info, MAX_COMMON_BUFFER_LEN, fp);
 
        if (cpu_info_p == nullptr) {
-               eprintf("fgets failed\n");
+               SCTRACE_ERROR("fgets failed");
                fclose(fp); /* free - code */
                return -ENOENT;
        }
@@ -604,7 +604,7 @@ MenuItem ad_menulist[] ={
 
 void precreate_ad(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_ad\n");
+       SCTRACE_ERROR("entered precreate_ad");
        menu->destroy();
        menu->addSubmenus(ad_menulist, sizeof(ad_menulist) / sizeof(MenuItem));
 }
index 88c88f2..15d736c 100644 (file)
@@ -32,7 +32,7 @@ static MENURUN_ERROR menugetstring_am_st(string &resultstr, int argc, char *argv
 
        int ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &ret_state);
        if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
-               eprintf("\tFlight mode get fail\n");
+               SCTRACE_ERROR("\tFlight mode get fail");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -46,7 +46,7 @@ MenuItem am_menulist[] ={
 
 void precreate_am(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_am\n");
+       SCTRACE_DEBUG("entered precreate_am");
        menu->destroy();
        menu->addSubmenus(am_menulist, sizeof(am_menulist) / sizeof(MenuItem));
 }
index ca33d8e..03b6566 100644 (file)
@@ -200,7 +200,7 @@ static MENURUN_ERROR menufunc_apps_lall(int argc, char *argv[], GenSettingMenu *
        Eina_List *apps;
        ret = app_manager_foreach_app_info(_app_info_cb, &apps);
        if (APP_MANAGER_ERROR_NONE != ret) {
-               eprintf("app_manager_foreach_app_info() Fail(%s)", get_error_message(ret));
+               SCTRACE_ERROR("app_manager_foreach_app_info() Fail(%s)", get_error_message(ret));
        }
 
        apps = appmgr_utils_sort_apps_list(g_sorttype, apps);
@@ -230,7 +230,7 @@ MenuItem apps_menulist[] ={
 
 void precreate_apps(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_apps\n");
+       SCTRACE_DEBUG("entered precreate_apps");
        menu->destroy();
        menu->addSubmenus(apps_menulist, sizeof(apps_menulist) / sizeof(MenuItem));
 }
index 6e9f566..280c134 100644 (file)
@@ -51,13 +51,13 @@ static void _get_battery_usage_details_list()
 
        ret =  context_history_create(&handle);
        if (ret != CONTEXT_HISTORY_ERROR_NONE) {
-               eprintf("\tcontext_history_create(): %s\n", get_error_message(ret));
+               SCTRACE_ERROR("\tcontext_history_create(): %s", get_error_message(ret));
                goto cleanup;
        }
 
        ret = context_history_filter_create(&filter);
        if (ret != CONTEXT_HISTORY_ERROR_NONE) {
-               eprintf("\tcontext_history_filter_create(): %s\n",
+               SCTRACE_ERROR("\tcontext_history_filter_create(): %s",
                                get_error_message(ret));
                goto cleanup;
        }
@@ -65,7 +65,7 @@ static void _get_battery_usage_details_list()
        ret = context_history_get_list(handle,
                        CONTEXT_HISTORY_RECENT_BATTERY_USAGE, filter, &list);
        if (ret != CONTEXT_HISTORY_ERROR_NONE) {
-               eprintf("\tcontext_history_get_list(): %s\n", get_error_message(ret));
+               SCTRACE_ERROR("\tcontext_history_get_list(): %s", get_error_message(ret));
                goto cleanup;
        }
 
@@ -121,7 +121,7 @@ MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu)
                        val = atoi(buf);
                        snprintf(str, sizeof(str), "%d %%", val);
                } else {
-                       eprintf("read file fail\n");
+                       SCTRACE_ERROR("read file fail");
                        snprintf(str, sizeof(str), "%s unavailable!\n", SETTING_ABOUT_POWER_SUPPLY_PATH);
                }
 
@@ -129,7 +129,7 @@ MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu)
                printf("\tBattery percentage : ");
                printf("%s\n\n", str);
        } else {
-               eprintf("open file fail\n");
+               SCTRACE_ERROR("open file fail");
                snprintf(str, sizeof(str), "%s unavailable!\n", SETTING_ABOUT_POWER_SUPPLY_PATH);
        }
 
index 08df796..5d2232a 100644 (file)
@@ -30,12 +30,12 @@ using namespace std;
 static MENURUN_ERROR menugetstring_bt_st(string &resultstr, int argc, char *argv[], GenSettingMenu *menu)
 {
        if (bt_initialize() != BT_ERROR_NONE) {
-               eprintf("bt_initialize() failed\n");
+               SCTRACE_ERROR("bt_initialize() failed");
                return MENURUN_ERR_NORMAL;
        }
        bt_adapter_state_e bt_state;
        if (bt_adapter_get_state(&bt_state) != BT_ERROR_NONE) {
-               eprintf("bt_adapter_get_state() failed\n");
+               SCTRACE_ERROR("bt_adapter_get_state() failed");
                bt_deinitialize();
                return MENURUN_ERR_NORMAL;
        }
@@ -51,7 +51,7 @@ MenuItem bt_menulist[] ={
 
 void precreate_bt(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_bt\n");
+       SCTRACE_DEBUG("entered precreate_bt");
        menu->destroy();
        menu->addSubmenus(bt_menulist, sizeof(bt_menulist) / sizeof(MenuItem));
 }
index 4f0cda6..c4638e0 100644 (file)
@@ -260,7 +260,7 @@ static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
 
        int ret = stc_stats_rule_create(stc, &rule);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_stats_rule_create() error: %s",
+               SCTRACE_ERROR("stc_stats_rule_create() error: %s",
                                                        get_error_message(ret));
                stc_stats_rule_destroy(rule);
                return true;
@@ -268,7 +268,7 @@ static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
 
        ret = stc_stats_rule_set_time_interval(rule, t_from, t_to);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
+               SCTRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
                                                        get_error_message(ret));
                stc_stats_rule_destroy(rule);
                return true;
@@ -276,17 +276,17 @@ static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
 
        ret = stc_stats_rule_set_iface_type(rule, iface);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
+               SCTRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
                                                        get_error_message(ret));
                stc_stats_rule_destroy(rule);
                return true;
        }
 
-       SETTINGCMD_TRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d",
+       SCTRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d",
                iface);
        ret = stc_foreach_stats(stc, rule, stats_cb, cb_data);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_get_stats() error: %s",
+               SCTRACE_ERROR("stc_get_stats() error: %s",
                                                        get_error_message(ret));
                if (STC_ERROR_IN_PROGRESS == ret) {
                        stc_stats_rule_destroy(rule);
@@ -310,14 +310,14 @@ static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_stats_rule_create(stc, &rule);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_stats_rule_create() error: %s",
+               SCTRACE_ERROR("stc_stats_rule_create() error: %s",
                                                        get_error_message(ret));
                return true;
        }
 
        ret = stc_stats_rule_set_time_interval(rule, t_from, t_to);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
+               SCTRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
                                                        get_error_message(ret));
                (void)stc_stats_rule_destroy(rule);
                return true;
@@ -325,17 +325,17 @@ static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_stats_rule_set_iface_type(rule, iface_type);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
+               SCTRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
                                                        get_error_message(ret));
                (void)stc_stats_rule_destroy(rule);
                return true;
        }
 
-       SETTINGCMD_TRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d",
+       SCTRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d",
                iface_type);
        ret = stc_get_total_stats(stc, rule, stats_cb, cb_data);
        if (ret != STC_ERROR_NONE) {
-               SETTINGCMD_TRACE_ERROR("stc_get_total_stats() error: %s",
+               SCTRACE_ERROR("stc_get_total_stats() error: %s",
                                                get_error_message(ret));
                (void)stc_stats_rule_destroy(rule);
                if (STC_ERROR_IN_PROGRESS == ret)
@@ -357,7 +357,7 @@ static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_restriction_rule_create(stc, &rule);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                        get_error_message(ret));
                return true;
        }
@@ -368,7 +368,7 @@ static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
                ret = stc_restriction_rule_set_app_id(rule, "TOTAL_WIFI");
 
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
                                                        get_error_message(ret));
                stc_restriction_rule_destroy(rule);
                return true;
@@ -376,18 +376,18 @@ static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_restriction_rule_set_iface_type(rule, iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_iface_type() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_get_iface_type() error: %s",
                                                        get_error_message(ret));
                stc_restriction_rule_destroy(rule);
                return true;
        }
 
-       SETTINGCMD_TRACE_DEBUG("\033[1;35mObtaining restrictions for iface: %d",
+       SCTRACE_DEBUG("\033[1;35mObtaining restrictions for iface: %d",
                iface_type);
        ret = stc_foreach_restriction(stc, rule, restrictions_cb,
                                                                        restriction_info_cb_data);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("SIM stc_foreach_restriction() error: %s",
+               SCTRACE_ERROR("SIM stc_foreach_restriction() error: %s",
                                                        get_error_message(ret));
                (void)stc_restriction_rule_destroy(rule);
                if (STC_ERROR_IN_PROGRESS == ret)
@@ -406,7 +406,7 @@ bool get_subscriber_id_from_telephony_handle(telephony_h handle,
 
        ret = telephony_sim_get_subscriber_id(handle, subscriber_id);
        if (TELEPHONY_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("telephony_sim_get_msin(%p) %s",
+               SCTRACE_ERROR("telephony_sim_get_msin(%p) %s",
                                                        handle, get_error_message(ret));
                return false;
        }
@@ -449,13 +449,13 @@ restrictions_result set_mobile_restriction_rule_parameters(
                                                                                        int64_t limit,
                                                                                        int64_t warning_limit)
 {
-       SETTINGCMD_TRACE_BEGIN;
+       SCTRACE_BEGIN;
        int ret = STC_ERROR_NONE;
 
        ret = stc_restriction_rule_set_app_id(rule, "TOTAL_DATACALL");
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -463,7 +463,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_iface_type(rule, STC_IFACE_DATACALL);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_iface_type() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_set_iface_type() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -471,7 +471,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_subscriber_id(rule, subscriber_id);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_subscriber_id() error:"\
+               SCTRACE_ERROR("stc_restriction_rule_set_subscriber_id() error:"\
                                                        "%s", get_error_message(ret));
 
                return RESTRICTIONS_ERROR;
@@ -480,7 +480,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_limit(rule, limit);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_limit() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_set_limit() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -488,27 +488,27 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_warning_limit(rule, warning_limit);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTINGCMD_TRACE_ERROR(
+               SCTRACE_ERROR(
                        "stc_restriction_rule_set_warning_limit() error: %s",
                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
 
-       SETTINGCMD_TRACE_END;
+       SCTRACE_END;
        return RESTRICTIONS_OK;
 }
 
 restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
                const char *subscriber_id, int64_t limit, int64_t warning_limit)
 {
-       SETTINGCMD_TRACE_BEGIN;
+       SCTRACE_BEGIN;
        int ret = STC_ERROR_NONE;
        stc_restriction_rule_h rule = nullptr;
        restrictions_result result = RESTRICTIONS_OK;
 
        ret = stc_restriction_rule_create(stc_handle, &rule);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -516,20 +516,20 @@ restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
        result = set_mobile_restriction_rule_parameters(rule, subscriber_id, limit,
                                                                                                        warning_limit);
        if (RESTRICTIONS_OK != result) {
-               SETTINGCMD_TRACE_ERROR("set_restriction_rule_parameters() error");
+               SCTRACE_ERROR("set_restriction_rule_parameters() error");
                return result;
        }
 
        ret = stc_set_restriction(stc_handle, rule);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTINGCMD_TRACE_ERROR("stc_set_restriction() error: %s",
+               SCTRACE_ERROR("stc_set_restriction() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
 
        (void)stc_restriction_rule_destroy(rule);
-       SETTINGCMD_TRACE_END;
+       SCTRACE_END;
        return RESTRICTIONS_OK;
 }
 
@@ -555,7 +555,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        restrictions_result restrictions_res = RESTRICTIONS_ERROR;
 
        if (!user_data) {
-               SETTINGCMD_TRACE_ERROR("_get_restrictions_to_unset_cb error: user_data == nullptr");
+               SCTRACE_ERROR("_get_restrictions_to_unset_cb error: user_data == nullptr");
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
        }
@@ -563,9 +563,9 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        stc_h stc = *((stc_h *)user_data);
 
-       SETTINGCMD_TRACE_DEBUG("_get_restrictions_to_unset_cb:");
+       SCTRACE_DEBUG("_get_restrictions_to_unset_cb:");
        if (STC_ERROR_NONE != result) {
-               SETTINGCMD_TRACE_ERROR("_get_restrictions_to_unset_cb error: %s",
+               SCTRACE_ERROR("_get_restrictions_to_unset_cb error: %s",
                                                        get_error_message(result));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -582,7 +582,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_type(rule, &type);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_get_type error: %s",
                                                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -590,7 +590,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_iface_type(rule, &iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_iface_type error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_get_iface_type error: %s",
                                                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -603,7 +603,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_subscriber_id(rule, &subscriber_id);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_subscriber_id error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_get_subscriber_id error: %s",
                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -611,7 +611,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_limit(rule, &limit);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_limit() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_get_limit() error: %s",
                        get_error_message(ret));
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -620,7 +620,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_warning_limit(rule, &warning_limit);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR(
+               SCTRACE_ERROR(
                        "stc_restriction_rule_get_warning_limit() error: %s",
                        get_error_message(ret));
                free(subscriber_id);
@@ -630,7 +630,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_create(stc, &mobile_rule);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                                        get_error_message(ret));
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -640,7 +640,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        restrictions_res = set_mobile_restriction_rule_parameters(mobile_rule,
                subscriber_id, limit, warning_limit);
        if (restrictions_res != RESTRICTIONS_OK) {
-               SETTINGCMD_TRACE_ERROR(
+               SCTRACE_ERROR(
                        "set_mobile_restriction_rule_parameters() error");
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -649,7 +649,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_unset_restriction(stc, mobile_rule);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_unset_restriction() error: %s",
+               SCTRACE_ERROR("stc_unset_restriction() error: %s",
                                                                        get_error_message(ret));
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -657,7 +657,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        }
        free(subscriber_id);
 
-       SETTINGCMD_TRACE_ERROR(
+       SCTRACE_ERROR(
                "stc_unset_restriction() successful unset restriction");
        g_main_loop_quit(multi_main_loop);
        return STC_CALLBACK_CONTINUE;
@@ -718,7 +718,7 @@ static void _set_stats_time_frame_from_cycle(Data_Limits_T *limits)
                break;
        case CYCLE_MODE_CUSTOM:
                if (limits->custom_mode_interval <= 0) {
-                       SETTINGCMD_TRACE_ERROR("Error: custom mode interval is %d",
+                       SCTRACE_ERROR("Error: custom mode interval is %d",
                                                                limits->custom_mode_interval);
                        return;
                }
@@ -746,23 +746,23 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
        int ret = STC_ERROR_NONE;
        stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
 
-       SETTINGCMD_TRACE_DEBUG("total stats cb, looking for subscriber id: %s",
+       SCTRACE_DEBUG("total stats cb, looking for subscriber id: %s",
                                                subscriber_id_to_look_for);
 
        if (STC_ERROR_NONE != result) {
-               SETTINGCMD_TRACE_ERROR("Error in cb: %s", get_error_message(result));
+               SCTRACE_ERROR("Error in cb: %s", get_error_message(result));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CANCEL;
        }
 
        ret = stc_stats_info_get_iface_type(info, &iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("get interface error: %s", get_error_message(ret));
-               eprintf(" There is no data usage.\n");
+               SCTRACE_ERROR("get interface error: %s", get_error_message(ret));
+               SCTRACE_DEBUG(" There is no data usage.");
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CANCEL;
        }
-       SETTINGCMD_TRACE_DEBUG("Obtained iface: %d", iface_type);
+       SCTRACE_DEBUG("Obtained iface: %d", iface_type);
        ret = stc_stats_info_get_counter(info, &incoming, &outgoing);
 
        if (STC_ERROR_NONE == ret) {
@@ -774,11 +774,11 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
                                                                                subscriber_id_to_look_for)
                                ) {
 
-                               SETTINGCMD_TRACE_DEBUG("Obtained SUBSCRIBER ID: %s",
+                               SCTRACE_DEBUG("Obtained SUBSCRIBER ID: %s",
                                                                        subscriber_id);
                                printf(" total in: %lld byte out: %lld byte\n", incoming, outgoing);
                        } else {
-                               SETTINGCMD_TRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
+                               SCTRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
                                                                                        get_error_message(ret));
                        }
                        free(subscriber_id);
@@ -788,7 +788,7 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
                        printf(" total in: %lld byte out: %lld byte\n", incoming, outgoing);
                }
        } else {
-               SETTINGCMD_TRACE_ERROR("get counter error: %s", get_error_message(ret));
+               SCTRACE_ERROR("get counter error: %s", get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CANCEL;
        }
@@ -808,9 +808,9 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
        stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
        stc_restriction_type_e type = STC_RSTN_TYPE_UNKNOWN;
 
-       SETTINGCMD_TRACE_DEBUG("restriction cb:");
+       SCTRACE_DEBUG("restriction cb:");
        if (STC_ERROR_NONE != result) {
-               SETTINGCMD_TRACE_ERROR("_get_restrictions_cb error: %s",
+               SCTRACE_ERROR("_get_restrictions_cb error: %s",
                                                        get_error_message(result));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -823,25 +823,25 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
        }
-       SETTINGCMD_TRACE_DEBUG("Obtaining restrictions for: %s", app_id);
+       SCTRACE_DEBUG("Obtaining restrictions for: %s", app_id);
        free(app_id);
 
        ret = stc_restriction_rule_get_type(rule, &type);
        if (STC_ERROR_NONE != ret) {
-               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
+               SCTRACE_ERROR("stc_restriction_rule_get_type error: %s",
                                                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
        }
 
        (void)stc_restriction_rule_get_iface_type(rule, &iface_type);
-       SETTINGCMD_TRACE_DEBUG("Obtained iface: %d", iface_type);
+       SCTRACE_DEBUG("Obtained iface: %d", iface_type);
        if (iface_type == STC_IFACE_DATACALL) {
 
                ret = stc_restriction_rule_get_subscriber_id(rule, &subscriber_id);
 
                if (STC_ERROR_NONE == ret) {
-                       SETTINGCMD_TRACE_DEBUG("Obtained Subscriber ID: %s", subscriber_id);
+                       SCTRACE_DEBUG("Obtained Subscriber ID: %s", subscriber_id);
                        int64_t limit_size = 0;
                        int64_t warning_size = 0;
                        stc_restriction_rule_get_limit(rule, &limit_size);
@@ -857,7 +857,7 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
                        printf("\t   warning_size : %s %s\n", buf, unit_s);
                        SIM++;
                } else {
-                       SETTINGCMD_TRACE_ERROR("stc_stats_rule_get_subscriber_id() error: %s",
+                       SCTRACE_ERROR("stc_stats_rule_get_subscriber_id() error: %s",
                                                                                get_error_message(ret));
                }
                free(subscriber_id);
@@ -885,7 +885,7 @@ static MENURUN_ERROR menufunc_du_gmwl(int argc, char *argv[], GenSettingMenu *me
 
        ret = stc_initialize(&stc);
        if (ret != STC_ERROR_NONE) {
-               eprintf("stc_initialize() error: %s\n", get_error_message(ret));
+               SCTRACE_ERROR("stc_initialize() error: %s\n", get_error_message(ret));
                return MENURUN_ERR_NORMAL;
        }
 
@@ -901,7 +901,7 @@ static MENURUN_ERROR menufunc_du_gmwl(int argc, char *argv[], GenSettingMenu *me
 static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *menu)
 {
        if (argc < 2) {
-               eprintf("Too short to execute this menu\n");
+               SCTRACE_ERROR("Too short to execute this menu");
 
                printf("First argument = warning(MB)\n");
                printf("Second argument = limit(MB)\n");
@@ -920,14 +920,14 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
 
 
        if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_init failed");
+               SCTRACE_ERROR("telephony_init failed");
                return MENURUN_ERR_NORMAL;
        }
 
        if (tel_h_list.count < 0) {
                printf("\tThere is no SIM card\n");
                if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
+                       SCTRACE_ERROR("telephony_deinit failed");
                        return MENURUN_ERR_NORMAL;
                }
                return MENURUN_ERR_NORMAL;
@@ -935,7 +935,7 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
 
        ret = stc_initialize(&stc);
        if (ret != STC_ERROR_NONE) {
-               eprintf("stc_initialize() error: %s\n", get_error_message(ret));
+               SCTRACE_ERROR("stc_initialize() error: %s", get_error_message(ret));
                return MENURUN_ERR_NORMAL;
        }
        int available_sim = 0;
@@ -952,7 +952,7 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
                                                tel_h_list.handle[i], &subscriber_id[i]);
 
                        if (ret == 0) {
-                               eprintf("get_subscriber_id_from_telephony_handle error! sim(%d) %d", i, ret);
+                               SCTRACE_DEBUG("get_subscriber_id_from_telephony_handle error! sim(%d) %d", i, ret);
                                continue;
                        }
                        if (!limit && !warning) {
@@ -975,7 +975,7 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
 
        stc_deinitialize(stc);
        if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_deinit failed");
+               SCTRACE_DEBUG("telephony_deinit failed");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -986,10 +986,10 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
 
 static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu)
 {
-       eprintf("[menufunc_du_mo] arguments %d : %s %s\n", argc, argv[0], argv[1]);
+       SCTRACE_DEBUG("[menufunc_du_mo] arguments %d : %s %s", argc, argv[0], argv[1]);
 
        if (argc < 2) {
-               eprintf("Too short to execute this function\n");
+               SCTRACE_ERROR("Too short to execute this function");
 
                printf("First argument = cycle mode, below.\n");
                printf("CYCLE_MODE_MONTHLY = 0\n");
@@ -1007,14 +1007,14 @@ static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu
        stc_h stc;
        int ret = 0;
        if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_init failed");
+               SCTRACE_ERROR("telephony_init failed");
                return MENURUN_ERR_NORMAL;
        }
 
        if (tel_h_list.count < 0) {
                printf("\tThere is no SIM card\n");
                if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
+                       SCTRACE_ERROR("telephony_deinit failed");
                        return MENURUN_ERR_NORMAL;
                }
                return MENURUN_ERR_NORMAL;
@@ -1038,7 +1038,7 @@ static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu
 
        ret = stc_initialize(&stc);
        if (ret != STC_ERROR_NONE) {
-               eprintf("stc_initialize() error: %s\n", get_error_message(ret));
+               SCTRACE_ERROR("stc_initialize() error: %s", get_error_message(ret));
                return MENURUN_ERR_NORMAL;
        }
        int available_sim = 0;
@@ -1055,7 +1055,7 @@ static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu
                                tel_h_list.handle[i], &subscriber_id[i]);
 
                        if (ret == 0) {
-                               eprintf("get_subscriber_id_from_telephony_handle error! sim(%d) %d\n", i, ret);
+                               SCTRACE_ERROR("get_subscriber_id_from_telephony_handle error! sim(%d) %d", i, ret);
                                continue;
                        }
 
@@ -1076,7 +1076,7 @@ static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu
 
        stc_deinitialize(stc);
        if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_deinit failed");
+               SCTRACE_ERROR("telephony_deinit failed");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -1086,7 +1086,7 @@ static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu
 static MENURUN_ERROR menufunc_du_wi(int argc, char *argv[], GenSettingMenu *menu)
 {
        if (argc < 2) {
-               eprintf("Too short to execute this function\n");
+               SCTRACE_ERROR("Too short to execute this function");
 
                printf("First argument = cycle mode, below.\n");
                printf("CYCLE_MODE_MONTHLY = 0\n");
@@ -1120,7 +1120,7 @@ static MENURUN_ERROR menufunc_du_wi(int argc, char *argv[], GenSettingMenu *menu
 
        ret = stc_initialize(&stc);
        if (ret != STC_ERROR_NONE) {
-               eprintf("stc_initialize() error: %s\n", get_error_message(ret));
+               SCTRACE_ERROR("stc_initialize() error: %s", get_error_message(ret));
                return MENURUN_ERR_NORMAL;
        }
 
@@ -1146,7 +1146,7 @@ MenuItem du_menulist[] ={
 
 void precreate_du(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_du\n");
+       SCTRACE_DEBUG("entered precreate_du");
        menu->destroy();
        menu->addSubmenus(du_menulist, sizeof(du_menulist) / sizeof(MenuItem));
 }
index a640ae8..b29c6db 100644 (file)
@@ -33,7 +33,7 @@ static MENURUN_ERROR menugetstring_dt_au(string &resultstr, int argc, char *argv
 
        int ret = vconf_get_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, &auto_update);
        if (ret != 0) {
-               eprintf("\tFail to get Auto update!\n");
+               SCTRACE_ERROR("\tFail to get Auto update!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -53,7 +53,7 @@ MenuItem dt_menulist[] ={
 
 void precreate_dt(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_dt\n");
+       SCTRACE_DEBUG("entered precreate_dt");
        menu->destroy();
        menu->addSubmenus(dt_menulist, sizeof(dt_menulist) / sizeof(MenuItem));
 }
index 345e51c..2a55da6 100644 (file)
@@ -32,7 +32,7 @@ static MENURUN_ERROR menugetstring_di_ab(string &resultstr, int argc, char *argv
        int auto_bright = 0;
        int ret = vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_bright);
        if (ret != 0) {
-               eprintf("\tAuto Bright get fail!\n");
+               SCTRACE_ERROR("\tAuto Bright get fail!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -46,7 +46,7 @@ static MENURUN_ERROR menugetstring_di_br(string &resultstr, int argc, char *argv
 
        int ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &brightness);
        if (ret != 0) {
-               eprintf("\tbrightness get fail!\n");
+               SCTRACE_ERROR("\tbrightness get fail!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -62,7 +62,7 @@ static MENURUN_ERROR menugetstring_di_fs(string &resultstr, int argc, char *argv
 
        int ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &fontsize);
        if (ret != 0) {
-               eprintf("\tFont get fail!\n");
+               SCTRACE_ERROR("\tFont get fail!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -98,7 +98,7 @@ MenuItem di_menulist[] ={
 
 void precreate_di(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_di\n");
+       SCTRACE_DEBUG("entered precreate_di");
        menu->destroy();
        menu->addSubmenus(di_menulist, sizeof(di_menulist) / sizeof(MenuItem));
 }
index 474fc0d..09bcd59 100644 (file)
@@ -65,7 +65,7 @@ static bool _sound_manager_init(sound_stream_info_t *info)
                                        &info->noti_sound_stream_info)
                                        != SOUND_MANAGER_ERROR_NONE)
                ) {
-               eprintf("Cannot create stream information ");
+               SCTRACE_ERROR("Cannot create stream information");
                return false;
        }
 
@@ -91,7 +91,7 @@ static MENURUN_ERROR menugetstring_so_rvol(string &resultstr, int argc, char *ar
 {
        sound_stream_info_t sound_stream_info;
        if (!_sound_manager_init(&sound_stream_info)) {
-               eprintf("_sound_manager_init() failed!");
+               SCTRACE_ERROR("_sound_manager_init() failed!");
                return MENURUN_ERR_NORMAL;
        }
        int vol = 0;
@@ -111,7 +111,7 @@ static MENURUN_ERROR menugetstring_so_nvol(string &resultstr, int argc, char *ar
 {
        sound_stream_info_t sound_stream_info;
        if (!_sound_manager_init(&sound_stream_info)) {
-               eprintf("_sound_manager_init() failed!");
+               SCTRACE_ERROR("_sound_manager_init() failed!");
                return MENURUN_ERR_NORMAL;
        }
        int vol = 0;
@@ -131,7 +131,7 @@ static MENURUN_ERROR menugetstring_so_mvol(string &resultstr, int argc, char *ar
 {
        sound_stream_info_t sound_stream_info;
        if (!_sound_manager_init(&sound_stream_info)) {
-               eprintf("_sound_manager_init() failed!");
+               SCTRACE_ERROR("_sound_manager_init() failed!");
                return MENURUN_ERR_NORMAL;
        }
        int vol = 0;
@@ -151,7 +151,7 @@ static MENURUN_ERROR menugetstring_so_svol(string &resultstr, int argc, char *ar
 {
        sound_stream_info_t sound_stream_info;
        if (!_sound_manager_init(&sound_stream_info)) {
-               eprintf("_sound_manager_init() failed!");
+               SCTRACE_ERROR("_sound_manager_init() failed!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -180,7 +180,7 @@ MenuItem so_menulist[] ={
 
 void precreate_so(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_so\n");
+       SCTRACE_DEBUG("entered precreate_so");
        menu->destroy();
        menu->addSubmenus(so_menulist, sizeof(so_menulist) / sizeof(MenuItem));
 }
index 7bb3823..6bd1796 100644 (file)
@@ -50,26 +50,8 @@ static int usb_request = 0;
 static char *usb_otg_path = 0;
 
 #define SETTING_CMD_MAX_STR_LEN 512
-
-#define __FREE(del, arg) do { \
-       if (arg) { \
-               /*cast any argument to (void*) to avoid build warring*/\
-               del((void *)(arg)); \
-               arg = nullptr; \
-       } \
-} while (0)
-#define FREE(arg) __FREE(free, arg)
 #define SAFE_STRDUP(src) (src) ? strdup(src) : nullptr
 
-#ifndef ret_if
-#define ret_if(expr) do { \
-       if (expr) { \
-               eprintf("(%s)\n", #expr); \
-               return ; \
-       } \
-} while (0)
-#endif
-
 static void storage_get_external_storage_status(const char *path, double *total,
                double *avail)
 {
@@ -89,7 +71,7 @@ static void __get_storage_capacity(char *str, int size)
        struct statvfs external;
 
        if (storage_get_internal_memory_size(&internal) < 0) {
-               eprintf("Fail to get internal memory size");
+               SCTRACE_ERROR("Fail to get internal memory size");
                snprintf(str, size, "%s", "_unavailable");
                return;
        } else {
@@ -97,24 +79,24 @@ static void __get_storage_capacity(char *str, int size)
                                * (long long int)internal.f_blocks;
                avail = (long long int)internal.f_bsize
                                * (long long int)internal.f_bavail;
-//             eprintf("Total mem : %lld, Avail mem : %lld\n",
+//             SCTRACE_DEBUG("Total mem : %lld, Avail mem : %lld",
 //                                     total, avail);
        }
 
        if (storage_get_external_memory_size(&external) < 0) {
-               eprintf("Fail to get external memory size");
+               SCTRACE_ERROR("Fail to get external memory size");
        } else {
                total += (long long int)external.f_frsize
                                * (long long int)external.f_blocks;
                avail += (long long int)external.f_bsize
                                * (long long int)external.f_bavail;
-//             eprintf("Total mem : %lld, Avail mem : %lld\n",
+//             SCTRACE_DEBUG("Total mem : %lld, Avail mem : %lld",
 //                             total, avail);
        }
 
        /* check if values are appropriate*/
        if (total < 0 || avail < 0 || total < avail) {
-               eprintf("Fail to get internal memory size");
+               SCTRACE_ERROR("Fail to get internal memory size");
                snprintf(str, size, "%s", "_unavailable");
                return;
        }
@@ -151,7 +133,7 @@ static int storage_get_media_info(const char *cond, media_info_cb cb,
        /*Set Filter*/
        ret = media_filter_create(&filter);
        if (MEDIA_CONTENT_ERROR_NONE != ret) {
-               eprintf("media_filter_create() Fail(%d)", ret);
+               SCTRACE_ERROR("media_filter_create() Fail(%d)", ret);
                return ret;
        }
 
@@ -159,7 +141,7 @@ static int storage_get_media_info(const char *cond, media_info_cb cb,
                        MEDIA_CONTENT_COLLATE_DEFAULT);
        if (MEDIA_CONTENT_ERROR_NONE != ret) {
                media_filter_destroy(filter);
-               eprintf("media_filter_set_condition() Fail(%d)\n",
+               SCTRACE_ERROR("media_filter_set_condition() Fail(%d)",
                                ret);
                return ret;
        }
@@ -167,15 +149,14 @@ static int storage_get_media_info(const char *cond, media_info_cb cb,
        ret = media_info_foreach_media_from_db(filter, cb, sizes);
        if (MEDIA_CONTENT_ERROR_NONE != ret) {
                media_filter_destroy(filter);
-               eprintf(
-                               "media_info_foreach_media_from_db() Fail(%d)\n",
+               SCTRACE_ERROR("media_info_foreach_media_from_db() Fail(%d)",
                                ret);
                return ret;
        }
 
        ret = media_filter_destroy(filter);
        if (MEDIA_CONTENT_ERROR_NONE != ret) {
-               eprintf("media_filter_destroy() Fail(%d)\n", ret);
+               SCTRACE_ERROR("media_filter_destroy() Fail(%d)", ret);
                return ret;
        }
 
@@ -202,7 +183,7 @@ static bool storage_get_media_item(media_info_h media, void *data)
                sizes->audio_total += size;
                break;
        default:
-               eprintf("Invalid Type(%d)", type);
+               SCTRACE_ERROR("Invalid Type(%d)", type);
                break;
        }
 
@@ -218,7 +199,7 @@ static bool storage_get_misces_item(media_info_h media, void *data)
        media_info_get_file_path(media, &file_path);
        #if 0
        if (!ecore_file_exists(file_path)) {
-               SETTINGCMD_TRACE_DEBUG("!ecore_file_exists(file_path)");
+               SCTRACE_ERROR("!ecore_file_exists(file_path)");
                FREE(file_path);
                return true;
        }
@@ -260,7 +241,7 @@ void storage_update_apps_cache_info(struct _calculated_sizes *sizes)
        multi_main_loop = g_main_loop_new(nullptr, FALSE);
        pc_total_size = pkgmgr_client_new(PC_REQUEST);
        if (nullptr == pc_total_size) {
-               eprintf("pkgmgr_client_new() Fail");
+               SCTRACE_ERROR("pkgmgr_client_new() Fail");
                return;
        }
 
@@ -269,7 +250,7 @@ void storage_update_apps_cache_info(struct _calculated_sizes *sizes)
 
        g_main_loop_run(multi_main_loop);
        if(PACKAGE_MANAGER_ERROR_NONE != ret)
-               eprintf("package_manager_get_total_package_size_info() Fail(%s)\n",
+               SCTRACE_ERROR("package_manager_get_total_package_size_info() Fail(%s)\n",
                                get_error_message(ret));
 }
 
@@ -293,8 +274,7 @@ static inline void storage_USB_unmount()
        int ret;
        ret = unmount_usb_storage(usb_otg_path);
        if (ret < 0) {
-               eprintf("unmount_usb_storage(%s) Fail(%d)\n",
-                               usb_otg_path, ret);
+               SCTRACE_ERROR("unmount_usb_storage(%s) Fail(%d)", usb_otg_path, ret);
                usb_request = STORAGE_USB_REQ_NONE;
        }
 }
@@ -305,8 +285,7 @@ static inline void storage_USB_mount()
 
        ret = mount_usb_storage(usb_otg_path);
        if (ret < 0) {
-               eprintf("mount_usb_storage(%s) Fail(%d)\n",
-                               usb_otg_path, ret);
+               SCTRACE_ERROR("mount_usb_storage(%s) Fail(%d)", usb_otg_path, ret);
                usb_request = STORAGE_USB_REQ_NONE;
        } else {
                printf("USB mount success\n");
@@ -326,8 +305,7 @@ static inline int storage_USB_format()
 
        ret = format_usb_storage(usb_otg_path);
        if (ret < 0) {
-               eprintf("format_usb_storage(%s) Fail(%d)\n",
-                               usb_otg_path, ret);
+               SCTRACE_ERROR("format_usb_storage(%s) Fail(%d)", usb_otg_path, ret);
                return MENURUN_ERR_NORMAL;
        }
        return MENURUN_ERR_NONE;
@@ -342,7 +320,7 @@ static inline void storage_USB_append_mounted_info()
        char avail_str[256] = { 0 };
 
        if (!usb_otg_path) {
-               eprintf("There is no usb otg path\n");
+               SCTRACE_ERROR("There is no usb otg path");
                return;
        }
 
@@ -377,7 +355,7 @@ static void storage_USB_cb(char *type, char *path, int mount, void *data)
        ret_if(nullptr == path);
        ret_if(nullptr == data);
 
-       eprintf("path:%s type:%s", path, type);
+       SCTRACE_DEBUG("path:%s type:%s", path, type);
 
        FREE(usb_otg_path);
        usb_otg_path = SAFE_STRDUP(path);
@@ -387,7 +365,7 @@ static void storage_USB_cb(char *type, char *path, int mount, void *data)
        } else if (!strcmp(type, "storage_mount")) {
                usb_otg_status = SETTING_STORAGE_USB_OTG_MOUNT;
                if (STORAGE_USB_REQ_UNMOUNT == usb_request) {
-                       eprintf("unmount_usb_storage() Fail\n");
+                       SCTRACE_ERROR("unmount_usb_storage() Fail");
                }
        } else if (!strcmp(type, "storage_unmount")) {
                usb_otg_status = SETTING_STORAGE_USB_OTG_UNMOUNT;
@@ -401,9 +379,9 @@ static void storage_USB_cb(char *type, char *path, int mount, void *data)
                        }
                        return;
                } else if (STORAGE_USB_REQ_FORMAT == usb_request) {
-                       eprintf("format_usb_storage() Fail\n");
+                       SCTRACE_ERROR("format_usb_storage() Fail");
                } else if (STORAGE_USB_REQ_MOUNT == usb_request) {
-                       eprintf("mount_usb_storage() Fail\n");
+                       SCTRACE_ERROR("mount_usb_storage() Fail");
                }
        } else if (!strcmp(type, "storage_updated")) {
                if (mount == 0)
@@ -421,20 +399,18 @@ void storage_init_USB()
 
        ret = init_usbhost_signal();
        if (ret < 0)
-               eprintf("init_usbhost_signal() Fail(%d)\n", ret);
+               SCTRACE_ERROR("init_usbhost_signal() Fail(%d)", ret);
 
        ret = register_usb_storage_change_handler(storage_USB_cb, nullptr);
        if (ret < 0) {
-               eprintf(
-                               "register_usb_storage_change_handler() Fail(%d)\n",
-                               ret);
+               SCTRACE_ERROR("register_usb_storage_change_handler() Fail(%d)\n", ret);
                deinit_usbhost_signal();
                return;
        }
 
        ret = request_usb_storage_info();
        if(ret < 0)
-               eprintf("request_usb_storage_info() - There is no usb storage, ret = %d\n", ret);
+               SCTRACE_ERROR("request_usb_storage_info() - There is no usb storage, ret = %d", ret);
 }
 
 void storage_deinit_USB()
@@ -455,14 +431,14 @@ int storage_get_internal_detail()
        cond = "((MEDIA_TYPE < 4) AND (MEDIA_STORAGE_TYPE=0))";
        ret = storage_get_media_info(cond, storage_get_media_item, &sizes);
        if(MEDIA_CONTENT_ERROR_NONE != ret)
-               eprintf("storage_get_media_info() Fail(%d)\n", ret);
+               SCTRACE_ERROR("storage_get_media_info() Fail(%d)", ret);
 
 
        cond_misc = "((MEDIA_TYPE=4) AND (MEDIA_STORAGE_TYPE=0))";
        ret = storage_get_media_info(cond_misc, storage_get_misces_item,
                        &sizes);
        if(MEDIA_CONTENT_ERROR_NONE != ret)
-               eprintf("storage_get_media_info() Fail(%d)\n", ret);
+               SCTRACE_ERROR("storage_get_media_info() Fail(%d)", ret);
 
 
        storage_size_to_str(sizes.app_total, desc, sizeof(desc));
@@ -489,7 +465,7 @@ static MENURUN_ERROR menufunc_st_me(int argc, char *argv[], GenSettingMenu *menu
 
        int media_ret = media_content_connect();
        if (MEDIA_CONTENT_ERROR_NONE != media_ret) {
-               eprintf("media_content_connect() Fail(0x%x)\n Please execute this app with \"owner\" user\n", (-1)*media_ret);
+               SCTRACE_ERROR("media_content_connect() Fail(0x%x)\n Please execute this app with \"owner\" user", (-1)*media_ret);
                return MENURUN_ERR_NORMAL;
        }
        __get_storage_capacity(buf, SETTING_CMD_MAX_STR_LEN);
@@ -511,12 +487,12 @@ static MENURUN_ERROR menufunc_st_sd(int argc, char *argv[], GenSettingMenu *menu
 
        int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SYSMAN_MMC_STATUS);
                return MENURUN_ERR_NORMAL;
        }
 
        if (sd_status != VCONFKEY_SYSMAN_MMC_MOUNTED){
-                       eprintf("SD card NOT mounted!\n");
+               SCTRACE_ERROR("SD card NOT mounted!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -542,18 +518,18 @@ static MENURUN_ERROR menufunc_st_ms(int argc, char *argv[], GenSettingMenu *menu
 
        int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SYSMAN_MMC_STATUS);
                return MENURUN_ERR_NORMAL;
        }
 
        if (sd_status == VCONFKEY_SYSMAN_MMC_MOUNTED){
-               eprintf("SD card already mounted!\n");
+               SCTRACE_ERROR("SD card already mounted!");
                return MENURUN_ERR_NORMAL;
        }
 
        ret = storage_request_mount_mmc(&mmc_content);
        if (ret == -1) {
-               eprintf("storage_request_mount_mmc() Fail\n");
+               SCTRACE_ERROR("storage_request_mount_mmc() Fail");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -567,7 +543,7 @@ static MENURUN_ERROR menufunc_st_mss(int argc, char *argv[], GenSettingMenu *men
 
        int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SYSMAN_MMC_STATUS);
                return MENURUN_ERR_NORMAL;
        }
 
@@ -587,18 +563,18 @@ static MENURUN_ERROR menufunc_st_us(int argc, char *argv[], GenSettingMenu *menu
 
        int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SYSMAN_MMC_STATUS);
                return MENURUN_ERR_NORMAL;
        }
 
        if (sd_status != VCONFKEY_SYSMAN_MMC_MOUNTED){
-                       eprintf("SD card NOT mounted!\n");
+                       SCTRACE_ERROR("SD card NOT mounted!");
                return MENURUN_ERR_NORMAL;
        }
 
        ret = storage_request_unmount_mmc(&mmc_content, MNT_FORCE);
        if (ret == -1) {
-               eprintf("storage_request_unmount_mmc() Fail\n");
+               SCTRACE_ERROR("storage_request_unmount_mmc() Fail");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -612,7 +588,7 @@ static MENURUN_ERROR menufunc_st_fs(int argc, char *argv[], GenSettingMenu *menu
        struct mmc_contents mmc_content = {0};
        int ret = storage_request_format_mmc(&mmc_content);
        if (ret == -1) {
-               eprintf("failed to call storage_request_format_mmc\n");
+               SCTRACE_ERROR("failed to call storage_request_format_mmc");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -626,13 +602,13 @@ static MENURUN_ERROR menufunc_st_ids(int argc, char *argv[], GenSettingMenu *men
 
        int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT, val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
                return MENURUN_ERR_NORMAL;
        }
 
        ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
                return MENURUN_ERR_NORMAL;
        }
        printf("Set internal memory for default storage shared content\n");
@@ -645,13 +621,13 @@ static MENURUN_ERROR menufunc_st_sds(int argc, char *argv[], GenSettingMenu *men
 
        int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT, val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
                return MENURUN_ERR_NORMAL;
        }
 
        ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
                return MENURUN_ERR_NORMAL;
        }
        printf("Set SD card for default storage shared content\n");
@@ -664,7 +640,7 @@ static MENURUN_ERROR menufunc_st_ida(int argc, char *argv[], GenSettingMenu *men
 
        int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
                return MENURUN_ERR_NORMAL;
        }
 
@@ -678,7 +654,7 @@ static MENURUN_ERROR menufunc_st_sda(int argc, char *argv[], GenSettingMenu *men
 
        int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
                return MENURUN_ERR_NORMAL;
        }
 
@@ -692,7 +668,7 @@ static MENURUN_ERROR menufunc_st_da(int argc, char *argv[], GenSettingMenu *menu
 
        int ret = vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, &val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
                return MENURUN_ERR_NORMAL;
        }
 
@@ -706,7 +682,7 @@ static MENURUN_ERROR menufunc_st_ds(int argc, char *argv[], GenSettingMenu *menu
 
        int ret = vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT, &val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
                return MENURUN_ERR_NORMAL;
        }
 
@@ -714,11 +690,11 @@ static MENURUN_ERROR menufunc_st_ds(int argc, char *argv[], GenSettingMenu *menu
 
        ret = vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, &val);
        if (ret != 0) {
-               eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
+               SCTRACE_ERROR("vconf_get_int(%s) fail!", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
                return MENURUN_ERR_NORMAL;
        }
 
-       printf("Default storage shared content with bluetooth : %s\n", (val)?"Internal memory":"SD Card");
+       printf("Default storage shared content with bluetooth : %s", (val)?"Internal memory":"SD Card");
     return MENURUN_ERR_NONE;
 }
 
@@ -740,7 +716,7 @@ MenuItem st_menulist[] ={
 
 void precreate_st(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_st\n");
+       SCTRACE_DEBUG("entered precreate_st");
        menu->destroy();
        menu->addSubmenus(st_menulist, sizeof(st_menulist) / sizeof(MenuItem));
 }
index 25f8127..402a783 100644 (file)
@@ -31,7 +31,7 @@ static MENURUN_ERROR menugetstring_wf_st(string &resultstr, int argc, char *argv
        int state = 0;
        int ret = vconf_get_int(VCONFKEY_WIFI_STATE, &state);
        if (ret != 0) {
-               eprintf("\twifi state get fail!\n");
+               SCTRACE_ERROR("\twifi state get fail!");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -44,7 +44,7 @@ static MENURUN_ERROR menugetstring_wf_nf(string &resultstr, int argc, char *argv
        bool state = false;
        int ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, &state);
        if (ret != 0) {
-               eprintf("\twifi notification get fail!\n");
+               SCTRACE_ERROR("\twifi notification get fail!\n");
                return MENURUN_ERR_NORMAL;
        }
 
@@ -60,7 +60,7 @@ MenuItem wf_menulist[] = {
 
 void precreate_wf(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_wf\n");
+       SCTRACE_DEBUG("entered precreate_wf");
        menu->destroy();
        menu->addSubmenus(wf_menulist, sizeof(wf_menulist)/ sizeof(MenuItem));
 }