Remove unnecessary logs
authorHyunwoo Kim <hwlove.kim@samsung.com>
Wed, 17 Apr 2013 12:23:58 +0000 (21:23 +0900)
committerHyunwoo Kim <hwlove.kim@samsung.com>
Wed, 17 Apr 2013 12:24:07 +0000 (21:24 +0900)
Change-Id: I2f4e22ade269cc425849ab87f95fcf73a9766ab9
Signed-off-by: Hyunwoo Kim <hwlove.kim@samsung.com>
client/src/PrivacyChecker.cpp
client/src/PrivacyManagerClient.cpp
client/src/SocketClient.cpp
client/src/privacy_manager_client.cpp
common/inc/SocketConnection.h
common/inc/Utils.h
common/src/PrivacyDb.cpp
common/src/PrivacyIdInfo.cpp
pkgmgr_plugin/privileges.cpp
server/src/NotificationServer.cpp
server/src/PrivacyManagerServer.cpp

index 3c46c2662ff3f0f987b08f26dd40416ccd67dfc4..c90267b9ec6d0b4e4294aa2bc6bf1c79511e4fe7 100644 (file)
@@ -204,16 +204,12 @@ PrivacyChecker::handleNotification(DBusConnection* connection, DBusMessage* mess
 int\r
 PrivacyChecker::check(const std::string privacyId, std::map < std::string, bool >& privacyMap)\r
 {\r
-       LOGI("enter, %d", privacyMap.size());\r
+       LOGI("enter");\r
 \r
        TryReturn(m_isInitialized, PRIV_MGR_ERROR_NOT_INITIALIZED, , "Not initialized");\r
 \r
        std::map < std::string, bool >::iterator iter;\r
 \r
-       for (iter = privacyMap.begin(); iter != privacyMap.end(); ++iter)\r
-       {\r
-               LOGD("data: %s, %d", iter->first.c_str(), iter->second);\r
-       }\r
        iter = privacyMap.find(privacyId);\r
        if (iter == privacyMap.end() )\r
        {\r
@@ -272,7 +268,7 @@ PrivacyChecker::check(const std::string pkgId, const std::string privacyId)
 \r
        if (iter->second.size() == 0)\r
        {\r
-               LOGD("NO PRIVACY contained");\r
+               LOGD("No privacy contained");\r
                return PRIV_MGR_ERROR_USER_NOT_CONSENTED;\r
        }\r
 \r
@@ -291,7 +287,7 @@ PrivacyChecker::checkWithPrivilege(const std::string pkgId, const std::string pr
        std::string privacyId;\r
        int res = PrivacyIdInfo::getPrivacyIdFromPrivilege(privilege, privacyId);\r
        if (res == PRIV_MGR_ERROR_NO_DATA) {\r
-               LOGD("NOT privacy privilege");\r
+               LOGD("%s is not privacy privilege", privilege.c_str());\r
                return PRIV_MGR_ERROR_SUCCESS;\r
        }\r
 \r
@@ -309,8 +305,11 @@ PrivacyChecker::checkWithPrivilege(const std::string privilege)
 \r
        std::string privacyId;\r
        int res = PrivacyIdInfo::getPrivacyIdFromPrivilege(privilege, privacyId);\r
-       if (res == PRIV_MGR_ERROR_NO_DATA)\r
+       if (res == PRIV_MGR_ERROR_NO_DATA) {\r
+               LOGD("%s is not privacy privilege", privilege.c_str());\r
                return PRIV_MGR_ERROR_SUCCESS;\r
+       }\r
+\r
        TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "getPrivacyIdFromPrivilege : %d", res);\r
 \r
        LOGI("leave");\r
@@ -327,6 +326,7 @@ PrivacyChecker::checkWithDeviceCap(const std::string pkgId, const std::string de
        int res = PrivacyIdInfo::getPrivacyIdFromDeviceCap(deviceCap, privacyId);\r
        if (res == PRIV_MGR_ERROR_NO_DATA)\r
                return PRIV_MGR_ERROR_SUCCESS;\r
+\r
        TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "getPrivacyIdFromPrivilege : %d", res);\r
 \r
        LOGI("leave");\r
@@ -343,6 +343,7 @@ PrivacyChecker::checkWithDeviceCap(const std::string deviceCap)
        int res = PrivacyIdInfo::getPrivacyIdFromDeviceCap(deviceCap, privacyId);\r
        if (res == PRIV_MGR_ERROR_NO_DATA)\r
                return PRIV_MGR_ERROR_SUCCESS;\r
+\r
        TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "getPrivacyIdFromPrivilege : %d", res);\r
 \r
        LOGI("leave");\r
@@ -369,7 +370,6 @@ PrivacyChecker::finalize(void)
                m_pHandlerGMainContext = NULL;\r
        }\r
 \r
-\r
        m_isInitialized = false;\r
 \r
        return PRIV_MGR_ERROR_SUCCESS;\r
@@ -404,7 +404,7 @@ PrivacyChecker::updateCache(const std::string pkgId, std::string privacyId, std:
        {\r
                bool privacyEnabled = sqlite3_column_int(pPrivacyStmt.get(), 0) > 0 ? true : false;\r
 \r
-               LOGI("Set result : %s : %d", privacyId.c_str(), privacyEnabled );\r
+               LOGD("Set result : %s : %d", privacyId.c_str(), privacyEnabled );\r
                pkgCacheMap.erase(privacyId);\r
                pkgCacheMap.insert(std::map < std::string, bool >::value_type(privacyId, privacyEnabled));\r
        }\r
index 7facd2663c6faca9da3d6e03058d7d074b6bae34..50d9bc6e0ab9f103299f53569302a84a7653f3fc 100644 (file)
@@ -145,10 +145,6 @@ PrivacyManagerClient::getAppPackagePrivacyInfo(const std::string pkgId, std::lis
        pSocketClient->disconnect();\r
        TryReturn(res == PRIV_MGR_ERROR_SUCCESS, res, , "disconnect : %d", res);\r
 \r
-       for (std::list < std::pair <std::string, bool > >::const_iterator iter = list.begin(); iter != list.end(); ++iter){\r
-               LOGD(" %s : %d", iter->first.c_str(), iter->second);\r
-       }\r
-\r
        return result;\r
 #endif \r
 \r
index 743d2d23f1b6607d7d9a6f212283c6a67b90d58d..20ecb3d47e551f2cc813d1628ff3e80eb5c99ab8 100644 (file)
 #include "SocketClient.h"\r
 #include <Utils.h>\r
 \r
-\r
-/*int\r
-SocketClient::throwWithErrnoMessage(const std::string& specificInfo){\r
-       LOGE("%s : %s", specificInfo.c_str(), strerror(errno));\r
-       return -1;\r
-}*/\r
-\r
 #define throwWithErrnoMessage(specificInfo)    do {\\r
                                                                                                LOGE("%s : %s", specificInfo, strerror(errno)); \\r
                                                                                                return -1; \\r
index 8f068902b196d5d4b8cadccf439431bdf29e229b..920c12b1938623073759d18537bf5c2f1b8ec417 100644 (file)
@@ -47,8 +47,6 @@ int create_privacy_info_client_s(const char* privacy_id, bool enabled, privacy_i
 \r
 int privacy_manager_client_install_privacy(const char *package_id, const char** privacy_list)\r
 {\r
-       LOGI("enter");\r
-\r
        PrivacyManagerClient* pInst = PrivacyManagerClient::getInstance();\r
        std::list < std::string > privacyList;\r
 \r
@@ -57,8 +55,6 @@ int privacy_manager_client_install_privacy(const char *package_id, const char**
 \r
        int retval = pInst->addAppPackagePrivacyInfo(std::string(package_id), privacyList, false);\r
 \r
-       LOGI("leave");\r
-\r
        return retval;\r
 }\r
 \r
@@ -176,10 +172,7 @@ int privacy_manager_client_foreach_package_list_by_privacy(const char *privacy_i
 \r
        std::list < std::pair < std::string, bool > > packageList;\r
        retval = pInst->getAppPackagesbyPrivacyId(std::string(privacy_id), packageList);\r
-               for (std::list < std::pair < std::string, bool > >::iterator iter = packageList.begin(); iter != packageList.end(); ++iter)\r
-       {\r
-               LOGD("result : %s %d", iter->first.c_str(), iter->second);\r
-       }\r
+\r
        if (retval != PRIV_MGR_ERROR_SUCCESS)\r
                return retval;\r
        if (packageList.size() == 0)\r
index 3fa291de5a4397217c833c939219ba8096649a05..14a50c2298b43c050d86c53b572326210140415f 100644 (file)
@@ -254,7 +254,6 @@ public:
                int length = strlen(in);\r
                int res = m_socketStream.writeStream(sizeof(length), &length);\r
                TryReturn(res == PRIV_MGR_ERROR_SUCCESS, res, , "writeStream : %d", res);\r
-               LOGD(" write char : %s %d", in, length);\r
                res = m_socketStream.writeStream(length, in);\r
                TryReturn(res == PRIV_MGR_ERROR_SUCCESS, res, , "writeStream : %d", res);\r
 \r
index 97bfad326128c3ce6b9e6b9913321feae2fde791..1e7c94ec4b1d04f21d68e9f843b18afd786cba0b 100644 (file)
@@ -46,8 +46,8 @@
                return r; \
        } else {;}
 
-auto StmtDeleter = [&](sqlite3_stmt* pPtr) { /*LOGI("sqlite3_finalize");*/ sqlite3_reset (pPtr); sqlite3_finalize(pPtr); };
-auto DbDeleter = [&](sqlite3* pPtr) { /*LOGI("sqlite3_close");*/ /*sqlite3_close(pPtr);*/ db_util_close(pPtr); };
+auto StmtDeleter = [&](sqlite3_stmt* pPtr) {  sqlite3_reset (pPtr); sqlite3_finalize(pPtr); };
+auto DbDeleter = [&](sqlite3* pPtr) { /*sqlite3_close(pPtr);*/ db_util_close(pPtr); };
 
 #define setStmtToUniquePtr(x, y)               std::unique_ptr < sqlite3_stmt, decltype(StmtDeleter) > x (y, StmtDeleter);
 #define setDbToUniquePtr(x, y)                 std::unique_ptr < sqlite3, decltype(DbDeleter) > x (y, DbDeleter);
index 95a6b77e7d45892b7bd133b1de77dc037d13081e..0d81d4c020b29aaa5dc09eb2d660193ac041daef 100644 (file)
@@ -117,8 +117,6 @@ PrivacyDb::getAppPackagePrivacyInfo(const std::string pkgId, std::list < std::pa
        int res = sqlite3_bind_text(pStmt.get(), 1, pkgId.c_str(), -1, SQLITE_TRANSIENT);
        TryReturn( res == SQLITE_OK, PRIV_MGR_ERROR_DB_ERROR, , "sqlite3_bind_int : %d", res);
 
-       LOGI("start");
-
        while ( (res= sqlite3_step(pStmt.get())) == SQLITE_ROW )
        {
                const char* privacyId =  reinterpret_cast < const char* > (sqlite3_column_text(pStmt.get(), 0));
@@ -218,12 +216,12 @@ PrivacyDb::isUserPrompted(const std::string pkgId, bool& isPrompted) const
 
        isPrompted = true;
 
-       if (isFilteredPackage(pkgId))\r
-       {\r
-               LOGD("%s is Filtered", pkgId.c_str());\r
-               return 0;\r
-       }\r
-\r
+       if (isFilteredPackage(pkgId))
+       {
+               LOGD("%s is Filtered", pkgId.c_str());
+               return 0;
+       }
+
        openDb(PRIVACY_DB_PATH.c_str(), pDbHandler, SQLITE_OPEN_READONLY);
        prepareDb(pDbHandler, query.c_str(), pStmt);
 
@@ -238,7 +236,7 @@ PrivacyDb::isUserPrompted(const std::string pkgId, bool& isPrompted) const
        }
        else
        {
-               LOGE("The package[%s] doesnt access privacy", pkgId.c_str());
+               LOGE("The package[%s] can not access privacy", pkgId.c_str());
                return PRIV_MGR_ERROR_SUCCESS;
        }
 
@@ -248,7 +246,7 @@ PrivacyDb::isUserPrompted(const std::string pkgId, bool& isPrompted) const
 int
 PrivacyDb::setUserPrompted(const std::string pkgId, bool prompted)
 {
-       LOGI("enter :%s - %d", pkgId.c_str(), prompted);
+       LOGI("enter");
 
        std::string query = std::string("UPDATE PackageInfo set IS_SET =? where PKG_ID=?");
 
@@ -266,6 +264,8 @@ PrivacyDb::setUserPrompted(const std::string pkgId, bool prompted)
        res = sqlite3_step(pStmt.get());
        TryReturn( res == SQLITE_DONE, PRIV_MGR_ERROR_DB_ERROR, , "sqlite3_step : %d", res);
 
+       LOGI("leave");
+
        return 0;
 }
 
@@ -288,11 +288,11 @@ PrivacyDb::getAppPackagesbyPrivacyId(std::string privacyId, std::list < std::pai
                
                const char* pPkgId =  reinterpret_cast < const char* > (sqlite3_column_text(pStmt.get(), 0));
                bool isEnabled = sqlite3_column_int(pStmt.get(), 1) > 0 ? true : false;
-               LOGD("result : %s %d", pPkgId, isEnabled);
+               LOGD("result : %s %d", pPkgId, isEnabled);
                list.push_back( std::pair <std::string, bool >(std::string(pPkgId), isEnabled) );
        }
 
-       LOGI("leave %d", res);
+       LOGI("leave");
 
        return PRIV_MGR_ERROR_SUCCESS;
 }
index 048f5277bad698208f3de4590f0009a4fbb36b98..7b18e1abd77f668e121c6023321aded9d8e453d9 100644 (file)
@@ -122,7 +122,6 @@ PrivacyIdInfo::initialize(void)
                const char* privilegeId =  reinterpret_cast < const char* > (sqlite3_column_text(pStmtPrivilege.get(), 0));\r
                const char* privacyId =  reinterpret_cast < const char* > (sqlite3_column_text(pStmtPrivilege.get(), 1));\r
                m_privilegeToPrivacyMap.insert(std::map < std::string, std::string >::value_type(std::string(privilegeId), std::string(privacyId)));\r
-               LOGD(" %s : %s", privilegeId, privacyId);\r
        }\r
 \r
        prepareDb(pDbHandler, sqlDeviceCap.c_str(), pStmtDeviceCap);\r
@@ -189,8 +188,6 @@ int
 PrivacyIdInfo::getAllPrivacyId(std::list < std::string >& privacyIdList)\r
 {\r
        static const std::string sql("SELECT PRIVACY_ID from PrivacyInfo");\r
-\r
-       LOGI("enter");\r
        \r
        openDb(PRIVACY_INFO_DB_PATH.c_str(), pDbHandler, SQLITE_OPEN_READONLY);\r
        prepareDb(pDbHandler, sql.c_str(), pStmt);\r
index d5cdc8bdea6c63b5a539c74d16691a0269febcee..c0612e367eaceb6ad69ef1153c6d144d768d01d1 100644 (file)
@@ -88,8 +88,6 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
                memcpy(ppPrivilegeList[i], iter->c_str(), strlen(iter->c_str()));\r
                ++iter;\r
        }\r
-       for (int i = 0; i < privilegeList.size(); ++i)\r
-               LOGD(" values : %s", ppPrivilegeList[i]);\r
 \r
        ppPrivilegeList[privilegeList.size()] = (char*)calloc (2, sizeof(char));\r
        memcpy(ppPrivilegeList[privilegeList.size()], "\0", 1);\r
index ce8bd647014f346861d7d29939f84ac0ad258df2..c9b5b6d379fc81798b42d735f3b38b3b42472e64 100644 (file)
@@ -56,7 +56,7 @@ NotificationServer::initialize(void)
        std::unique_ptr < char[] > pRule(new char[MAX_LOCAL_BUF_SIZE]);\r
 \r
        snprintf(pRule.get(), MAX_LOCAL_BUF_SIZE, "path='%s',type='signal',interface='%s'", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str());\r
-       LOGD("rule : %s" ,pRule.get());\r
+\r
        dbus_bus_add_match(m_pDBusConnection, pRule.get(), &error);\r
        TryReturn(!dbus_error_is_set(&error), PRIV_MGR_ERROR_SYSTEM_ERROR, dbus_error_free(&error), "dbus_bus_add_match : %s", error.message);\r
 \r
@@ -74,7 +74,7 @@ NotificationServer::notifySettingChanged(const std::string pkgId, const std::str
 \r
        char* pPkgId = const_cast <char*> (pkgId.c_str());\r
        char* pPrivacyId = const_cast <char*> (privacyId.c_str());\r
-       LOGD("path: %s, inter: %s, name: %s", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_SETTING_CHANGED.c_str());\r
+\r
        DBusMessage* pMessage = dbus_message_new_signal(DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_SETTING_CHANGED.c_str());\r
        TryReturn(pMessage != NULL, PRIV_MGR_ERROR_IPC_ERROR, , "dbus_message_new_signal");\r
 \r
@@ -105,7 +105,7 @@ NotificationServer::notifyPkgRemoved(const std::string pkgId)
                return PRIV_MGR_ERROR_INVALID_STATE;\r
 \r
        char* pPkgId = const_cast <char*> (pkgId.c_str());\r
-       LOGD("path: %s, inter: %s, name: %s", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_PKG_REMOVED.c_str());\r
+\r
        DBusMessage* pMessage = dbus_message_new_signal(DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_PKG_REMOVED.c_str());\r
        TryReturn(pMessage != NULL, PRIV_MGR_ERROR_IPC_ERROR, , "dbus_message_new_signal");\r
 \r
index 85f38b45bddb9afed64df218b5a555d2afd75cd2..e6b2a4b82cfd903e0f0f7206d68f5989fa7495de 100644 (file)
@@ -33,8 +33,6 @@ PrivacyManagerServer::createDB(void)
 int\r
 PrivacyManagerServer::setPrivacySetting(const std::string pkgId, const std::string privacyId, bool enabled)\r
 {\r
-       LOGD("Set Privacy: %s, %s, %d", pkgId.c_str(), privacyId.c_str(), enabled);\r
-\r
        int res = PrivacyDb::getInstance()->setPrivacySetting(pkgId, privacyId, enabled);\r
        TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "privacyDb::setPrivacySetting : %d", res);\r
 \r