Updating debug logs for format check enforcement 86/195086/3 accepted/tizen/unified/20181217.142241 submit/tizen/20181212.095503 submit/tizen/20181214.061228
authorAbhishek Vijay <abhishek.v@samsung.com>
Mon, 10 Dec 2018 12:18:09 +0000 (17:48 +0530)
committerAbhishek Vijay <abhishek.v@samsung.com>
Tue, 11 Dec 2018 11:45:23 +0000 (17:15 +0530)
Change-Id: Ifc0a4fede161146437448ba893dc480b490cee1f
Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
src/sync-client/sync_manager.c
src/sync-service/SyncManager_CurrentSyncJobQueue.cpp
src/sync-service/SyncManager_PeriodicSyncScheduler.cpp
src/sync-service/SyncManager_RepositoryEngine.cpp
src/sync-service/SyncManager_SyncJobDispatcher.cpp
src/sync-service/SyncManager_SyncJobQueue.cpp
src/sync-service/SyncManager_SyncJobsInfo.cpp
src/sync-service/SyncManager_SyncManager.cpp
src/sync-service/SyncManager_SyncService.cpp
src/sync-service/SyncManager_SyncStatusInfo.cpp
src/sync-service/SyncManager_SyncWorker.cpp

index 0c3102cb482bcfb29583a112da5ddaf8b9f41fb8..4a73c8b500eac912b3c83d37e2c6e40386571a20 100644 (file)
@@ -163,6 +163,7 @@ static int _sync_get_error_code(bool is_success, GError *error)
                        if (remote_error) {
                                LOG_LOGD("Remote error [%s]", remote_error);
                                if (g_str_has_prefix(remote_error, SYNC_ERROR_PREFIX) == true) {
+                                       LOG_LOGD("Error prefix - [%s]", SYNC_ERROR_PREFIX);
                                        int error_enum_count = G_N_ELEMENTS(_sync_errors);
                                        for (int i = 0; i < error_enum_count; i++) {
                                                if (g_strcmp0(_sync_errors[i].dbus_error_name, remote_error) == 0) {
@@ -173,6 +174,7 @@ static int _sync_get_error_code(bool is_success, GError *error)
                                                }
                                        }
                                } else if (g_str_has_prefix(remote_error, FREEDEKTOP_ERROR_PREFIX) == true) {
+                                       LOG_LOGD("Error prefix - [%s]", FREEDEKTOP_ERROR_PREFIX);
                                        const char* error_name = FREEDEKTOP_ERROR_PREFIX".AccessDenied";
                                        if (g_strcmp0(error_name, remote_error) == 0) {
                                                LOG_LOGD("Error code matched with freedesktop error");
index 5f8bcb3809716e7ee13a2c5d5a0875f2342b7d0e..9252704094cc56e8ceed0867d013d9afa38cc634 100644 (file)
@@ -46,7 +46,7 @@ CurrentSyncJobQueue::~CurrentSyncJobQueue(void) {
 
 int
 CurrentSyncJobQueue::AddSyncJobToCurrentSyncQueue(SyncJob* syncJob) {
-       LOG_LOGD("Active Sync Jobs Queue size : Before = [%d]", __currentSyncJobQueue.size());
+       LOG_LOGD("Active Sync Jobs Queue size : Before = [%zu]", __currentSyncJobQueue.size());
 
        map<const string, CurrentSyncContext*>::iterator it;
        it = __currentSyncJobQueue.find(syncJob->__key);
@@ -77,7 +77,7 @@ CurrentSyncJobQueue::AddSyncJobToCurrentSyncQueue(SyncJob* syncJob) {
                         return SYNC_ERROR_ALREADY_IN_PROGRESS;
                }
        }
-       LOG_LOGD("Active Sync Jobs Queue size : After = [%d]", __currentSyncJobQueue.size());
+       LOG_LOGD("Active Sync Jobs Queue size : After = [%zu]", __currentSyncJobQueue.size());
 
        return SYNC_ERROR_NONE;
 }
@@ -127,7 +127,7 @@ bool
 CurrentSyncJobQueue::IsJobActive(CurrentSyncContext *pCurrSync) {
        LOG_LOGD("CurrentSyncJobQueue::IsJobActive() Starts");
 
-       LOG_LOGD("job q size [%d]", __currentSyncJobQueue.size());
+       LOG_LOGD("job q size [%zu]", __currentSyncJobQueue.size());
 
        if (pCurrSync == NULL) {
                return false;
@@ -164,7 +164,7 @@ CurrentSyncJobQueue::RemoveSyncContextFromCurrentSyncQueue(CurrentSyncContext* p
        map<const string, CurrentSyncContext*>::iterator it = __currentSyncJobQueue.find(pSyncJob->__key);
        CurrentSyncContext* pCurrContext = it->second;
        __currentSyncJobQueue.erase(it);
-       LOG_LOGD("Active Sync Jobs queue size, After = [%d]", __currentSyncJobQueue.size());
+       LOG_LOGD("Active Sync Jobs queue size, After = [%zu]", __currentSyncJobQueue.size());
        delete pCurrContext;
        pCurrContext = NULL;
 
index ddd71623238473098718eac0c95ad7fa684d0371..79ed245a9a61e3741c243be91b2d4348002376ab 100644 (file)
@@ -99,7 +99,7 @@ PeriodicSyncScheduler::SchedulePeriodicSyncJob(PeriodicSyncJob* periodicSyncJob)
        ret = alarmmgr_add_periodic_alarm_withcb(periodicSyncJob->__period, QUANTUMIZE, PeriodicSyncScheduler::OnAlarmExpired, this, &alarm_id);
        /* ret = alarmmgr_add_periodic_alarm_withcb(2, QUANTUMIZE, PeriodicSyncScheduler::OnAlarmExpired, this, &alarm_id); */
        if (ret == ALARMMGR_RESULT_SUCCESS) {
-               LOG_LOGD("Alarm added for %ld min, id %ld", periodicSyncJob->__period, alarm_id);
+               LOG_LOGD("Alarm added for %ld min, id %d", periodicSyncJob->__period, alarm_id);
                /* LOG_LOGD("Alarm added for [%ld] min, id [%ld]", 2, alarm_id); */
 
                __activePeriodicSyncJobs.insert(make_pair(alarm_id, periodicSyncJob));
@@ -109,7 +109,7 @@ PeriodicSyncScheduler::SchedulePeriodicSyncJob(PeriodicSyncJob* periodicSyncJob)
                return SYNC_ERROR_SYSTEM;
        }
 
-       LOG_LOGD("Active periodic alarm count, [%d]", __activePeriodicSyncJobs.size());
+       LOG_LOGD("Active periodic alarm count, [%zu]", __activePeriodicSyncJobs.size());
 
        return SYNC_ERROR_NONE;
 }
index 187800179985efd49e6bbfc93885994cb81a17b9..8ef70c542b239df903dc0d90eaef83ad82a97707 100644 (file)
@@ -489,7 +489,7 @@ RepositoryEngine::WriteSyncJobsData(void) {
 
        ss << syncJobs.size();
        xmlNewProp(rootNode, XML_ATTR_COUNT, (const xmlChar*)ss.str().c_str());
-       LOG_LOGD("size [%d]", syncJobs.size());
+       LOG_LOGD("size [%zu]", syncJobs.size());
 
        map<string, SyncJobsInfo*>::iterator itr = syncJobs.begin();
        while (itr != syncJobs.end()) {
index 0d4111163fb3655d18fa0e3ccf4c4deb5747f46c..82c07da22d2450d3ab3c836dd05ce0f741e55958 100644 (file)
@@ -245,7 +245,7 @@ SyncJobDispatcher::TryStartingNextJobLocked() {
 
        if (syncJobToRun == NULL && !jobQueue.empty()) {
                LOG_LOGD("Non priority job found");
-               LOG_LOGD("Non priority size: [%d]", jobQueue.size());
+               LOG_LOGD("Non priority size: [%zu]", jobQueue.size());
                syncJobToRun = jobQueue.front();
                jobQueue.pop_front();
                if (syncJobToRun == NULL)
index 6468e208372d887a317c1660b4d1d7b2a9add4ef..30e8a23cfab826c0f7f4205dd14fba42a8b7b680 100644 (file)
@@ -76,13 +76,13 @@ SyncJobQueue::AddSyncJob(SyncJob* pSyncJob) {
        SYNC_LOGE_RET_RES(pSyncJobEntry != NULL, SYNC_ERROR_SYSTEM, "Failed to get sync job");
 
        if (pSyncJobEntry->IsExpedited()) {
-               LOG_LOGD("Priority SyncJob Queue size, before = [%d]", __prioritySyncJobsQueue.size());
+               LOG_LOGD("Priority SyncJob Queue size, before = [%zu]", __prioritySyncJobsQueue.size());
                __prioritySyncJobsQueue.push_back(pSyncJob);
-               LOG_LOGD("Priority SyncJob Queue size, after = [%d]", __prioritySyncJobsQueue.size());
+               LOG_LOGD("Priority SyncJob Queue size, after = [%zu]", __prioritySyncJobsQueue.size());
        } else {
-               LOG_LOGD("SyncJob Queue size, before = [%d]", __syncJobsQueue.size());
+               LOG_LOGD("SyncJob Queue size, before = [%zu]", __syncJobsQueue.size());
                __syncJobsQueue.push_back(pSyncJob);
-               LOG_LOGD("SyncJob Queue size, after = [%d]", __syncJobsQueue.size());
+               LOG_LOGD("SyncJob Queue size, after = [%zu]", __syncJobsQueue.size());
        }
 
        return SYNC_ERROR_NONE;
@@ -92,13 +92,13 @@ SyncJobQueue::AddSyncJob(SyncJob* pSyncJob) {
 int
 SyncJobQueue::RemoveSyncJob(SyncJob* pSyncJob) {
        if (pSyncJob ->IsExpedited()) {
-               LOG_LOGD("Priority SyncJob Queue size, before = [%d]", __prioritySyncJobsQueue.size());
+               LOG_LOGD("Priority SyncJob Queue size, before = [%zu]", __prioritySyncJobsQueue.size());
                __prioritySyncJobsQueue.remove(pSyncJob);
-               LOG_LOGD("Priority SyncJob Queue size, after = [%d]", __prioritySyncJobsQueue.size());
+               LOG_LOGD("Priority SyncJob Queue size, after = [%zu]", __prioritySyncJobsQueue.size());
        } else {
-               LOG_LOGD("SyncJob Queue size, before = [%d]", __syncJobsQueue.size());
+               LOG_LOGD("SyncJob Queue size, before = [%zu]", __syncJobsQueue.size());
                __syncJobsQueue.remove(pSyncJob);
-               LOG_LOGD("SyncJob Queue size, after = [%d]", __syncJobsQueue.size());
+               LOG_LOGD("SyncJob Queue size, after = [%zu]", __syncJobsQueue.size());
        }
 
        return SYNC_ERROR_NONE;
index efef10a6420d049765f4c4461931252cb90ddf2b..f0dbc74e219af3815893b7f0eb59837fa18ace09 100644 (file)
@@ -122,7 +122,7 @@ SyncJobsInfo::RemoveSyncJob(string syncJobname) {
 /* LCOV_EXCL_START */
 void
 SyncJobsInfo::RemoveAllSyncJobs() {
-       LOG_LOGD("Removing Sync jobs for package [%s]. Count [%d] ", __packageId.c_str(), __syncIdList.size());
+       LOG_LOGD("Removing Sync jobs for package [%s]. Count [%zd] ", __packageId.c_str(), __syncIdList.size());
 
        map<int, ISyncJob*>::iterator itr = __syncIdList.begin();
        while (itr != __syncIdList.end()) {
index aed6c9a788c0db6a367b20b96aa309879fb6c949..38612ea618bf23a1879e9d955a3a92728b17607f 100644 (file)
@@ -106,10 +106,11 @@ SyncManager::CancelSync(SyncJob* pSyncJob) {
 
 int
 SyncManager::AddPeriodicSyncJob(string pPackageId, int uid, const char* syncJobName, int accountId, bundle* pExtras, int syncOption, int syncJobId, long period) {
-       if (period < 1800) {
+       unsigned int lperiod = (unsigned int)period;
+       if (lperiod < 1800) {
                /* LCOV_EXCL_START */
-               LOG_LOGD("Requested period %d is less than minimum, rounding up to 30 mins", period);
-               period = 1800;
+               LOG_LOGD("Requested period %d is less than minimum, rounding up to 30 mins", lperiod);
+               lperiod = 1800;
                /* LCOV_EXCL_STOP */
        }
 
@@ -119,12 +120,12 @@ SyncManager::AddPeriodicSyncJob(string pPackageId, int uid, const char* syncJobN
 
        if (accountId != -1 && !GetSyncSupport(accountId)) {
                /* LCOV_EXCL_START */
-               LOG_LOGD("Sync is not enabled for account ID %s", accountId);
+               LOG_LOGD("Sync is not enabled for account ID %d", accountId);
                return SYNC_ERROR_SYSTEM;
                /* LCOV_EXCL_STOP */
        }
 
-       PeriodicSyncJob* pRequestedJob = new (std::nothrow) PeriodicSyncJob(pSyncAdapterApp, uid, syncJobName, accountId, pExtras, syncOption, syncJobId, SYNC_TYPE_PERIODIC, period / 60);
+       PeriodicSyncJob* pRequestedJob = new (std::nothrow) PeriodicSyncJob(pSyncAdapterApp, uid, syncJobName, accountId, pExtras, syncOption, syncJobId, SYNC_TYPE_PERIODIC, lperiod / 60);
        SYNC_LOGE_RET_RES(pRequestedJob != NULL, SYNC_ERROR_OUT_OF_MEMORY, "Failed to construct periodic SyncJob");
 
        __pSyncJobsAggregator->AddSyncJob(pPackageId.c_str(), uid, syncJobName, pRequestedJob);
@@ -149,7 +150,7 @@ SyncManager::AddDataSyncJob(string pPackageId, int uid, const char* syncJobName,
 
        if (accountId != -1 && !GetSyncSupport(accountId)) {
                /* LCOV_EXCL_START */
-               LOG_LOGD("Sync is not enabled for account ID %s", accountId);
+               LOG_LOGD("Sync is not enabled for account ID %d", accountId);
                return SYNC_ERROR_SYSTEM;
                /* LCOV_EXCL_STOP */
        }
index 868facebec7ec09bb759c9508c23d0a18ae1c0dc..a4e7711547292599426438be7bf2d3e4fb667ee1 100644 (file)
@@ -405,7 +405,7 @@ SyncService::TriggerStartSync(const char* appId, int uid, int accountId, const c
                                interface = G_DBUS_INTERFACE_SKELETON(pSyncAdapter);
                                if (g_dbus_interface_skeleton_export(interface, gdbusConnection, object_path, &error)) {
                                        g_signal_connect(pSyncAdapter, "handle-send-result", G_CALLBACK(sync_adapter_handle_send_result), NULL);
-                                       LOG_LOGD("inserting sync adapter ipc [%s][%x]", appId, pSyncAdapter);
+                                       LOG_LOGD("inserting sync adapter ipc [%s][%p]", appId, (void*)pSyncAdapter);
                                        g_hash_table_insert(g_hash_table, (gpointer)g_strdup(appId), (gpointer)pSyncAdapter);
                                } else {
                                        SYNC_LOGE_RET_RES(!(error->message), SYNC_ERROR_SYSTEM, "export failed [%s]", error->message);
@@ -637,7 +637,7 @@ get_num_of_sync_jobs(string pkgId) {
                if (pPackageSyncJobs != NULL) {
                        map<int, ISyncJob*>& allSyncJobs = pPackageSyncJobs->GetAllSyncJobs();
                        if (!allSyncJobs.empty()) {
-                               LOG_LOGD("Package ID [%s], it has [%d] sync job", pkgId.c_str(), allSyncJobs.size());
+                               LOG_LOGD("Package ID [%s], it has [%zu] sync job", pkgId.c_str(), allSyncJobs.size());
                        } else {
                                LOG_LOGD("Package ID [%s], doesn't have any sync job", pkgId.c_str());
                                return 0;
@@ -1071,7 +1071,7 @@ sync_manager_add_sync_adapter(TizenSyncManager* pObject, GDBusMethodInvocation*
                                                if (g_dbus_interface_skeleton_export(interface, gdbusConnection, object_path, &error)) {
                                                        g_signal_connect(syncAdapterObj, "handle-send-result", G_CALLBACK(sync_adapter_handle_send_result), NULL);
                                                        pAggregator->AddSyncAdapter((const char*)pkgIdStr.c_str(), pAppId);
-                                                       LOG_LOGD("inserting sync adapter ipc [%s][%x]", pAppId, syncAdapterObj);
+                                                       LOG_LOGD("inserting sync adapter ipc [%s][%p]", pAppId, (void*)syncAdapterObj);
                                                        g_hash_table_insert(g_hash_table, (gpointer)g_strdup(pAppId), (gpointer)syncAdapterObj);
                                                        ret = SYNC_ERROR_NONE;
                                                } else {
@@ -1115,11 +1115,11 @@ sync_manager_add_sync_adapter(TizenSyncManager* pObject, GDBusMethodInvocation*
                                g_signal_connect(syncAdapterObj, "handle-send-result", G_CALLBACK(sync_adapter_handle_send_result), NULL);
                                if (isApp) {
                                        pAggregator->AddSyncAdapter((const char*)pkgIdStr.c_str(), pAppId);
-                                       LOG_LOGD("inserting sync adapter ipc [%s][%x]", pAppId, syncAdapterObj);
+                                       LOG_LOGD("inserting sync adapter ipc [%s][%p]", pAppId, (void*)syncAdapterObj);
                                        g_hash_table_insert(g_hash_table, (gpointer)g_strdup(pAppId), (gpointer)syncAdapterObj);
                                } else {
                                        pAggregator->AddSyncAdapter((const char*)pkgIdStr.c_str(), (const char*)pkgIdStr.c_str());
-                                       LOG_LOGD("inserting sync adapter ipc [%s][%x]", pkgIdStr.c_str(), syncAdapterObj);
+                                       LOG_LOGD("inserting sync adapter ipc [%s][%p]", pkgIdStr.c_str(), (void*)syncAdapterObj);
                                        g_hash_table_insert(g_hash_table, (gpointer)g_strdup(pkgIdStr.c_str()), (gpointer)syncAdapterObj);
                                }
                                ret = SYNC_ERROR_NONE;
@@ -1310,7 +1310,7 @@ sync_manager_get_all_sync_jobs(TizenSyncManager* pObject, GDBusMethodInvocation*
                        map<int, ISyncJob*>& allSyncJobs = pPackageSyncJobs->GetAllSyncJobs();
                        if (!allSyncJobs.empty()) {
                                g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
-                               LOG_LOGD("Package has [%d] sync jobs", allSyncJobs.size());
+                               LOG_LOGD("Package has [%zu] sync jobs", allSyncJobs.size());
                                map< int, ISyncJob* >::iterator itr = allSyncJobs.begin();
                                while (itr != allSyncJobs.end()) {
                                        ISyncJob* syncJob = itr->second;
@@ -1497,7 +1497,7 @@ SyncService::SyncService(void)
 
 static void
 free_hash_table_items(gpointer key, gpointer value, gpointer user_data) {
-       LOG_LOGD("free g_hash_table - key : [%s], value : [%x]", (char *)key, value);
+       LOG_LOGD("free g_hash_table - key : [%s], value : [%p]", (char *)key, (void*)value);
        g_free(key);
 }
 
index d4957e3b6eb24687712d54c15b61f415e32f6542..4dbf1fdedad754ebdeead67bbd80a3823e2d66fa 100644 (file)
@@ -137,7 +137,7 @@ SyncStatusInfo::GetStatusInfoString(void) {
                buff.append(ss.str().c_str());
                ss.str(string());
 
-               LOG_LOGD("writing sync time now, size = %d", __periodicSyncTimes.size());
+               LOG_LOGD("writing sync time now, size = %zu", __periodicSyncTimes.size());
                buff.append(" ");
                ss << __periodicSyncTimes.size();
                buff.append(ss.str().c_str());
index 98705b9e9e5e5ee707c585c1add7ba30b0bc1060..a0e586a03bdaeb4d9ac3b783e4a085adf5038e27 100644 (file)
@@ -156,18 +156,16 @@ SyncWorker::AddRequestN(ISyncWorkerResultListener* pSyncWorkerResultListener, Me
 
                uint64_t count = 1;
                gsize writtenSize = 0;
-               //              GError* error = NULL;
-               //              GIOStatus status;
 
                pthread_mutex_lock(&__pendingRequestsMutex);
                __pendingRequests.push_back(pRequestData);
-               LOG_LOGD("Added into __pendingRequests, current size = %d", __pendingRequests.size());
+               LOG_LOGD("Added into __pendingRequests, current size = %zu", __pendingRequests.size());
                pthread_mutex_unlock(&__pendingRequestsMutex);
 
                GError* pError = NULL;
                int status = g_io_channel_write_chars(__pChannel, (const gchar*) &count, sizeof(count), &writtenSize, &pError);
                if (status != G_IO_STATUS_NORMAL) {
-                       LOG_LOGD("SyncWorker::Add Request Failed with IO Write Error %d %d", status, count);    /* LCOV_EXCL_LINE */
+                       LOG_LOGD("SyncWorker::Add Request Failed with IO Write Error %d %llu", status, (long long unsigned)count);      /* LCOV_EXCL_LINE */
                        return SYNC_ERROR_SYSTEM;
                }
                g_io_channel_flush(__pChannel, &pError);
@@ -205,7 +203,7 @@ SyncWorker::OnEventReceived(GIOChannel* pChannel, GIOCondition condition, gpoint
                if (*it != NULL) {
                        RequestData* pData = *it;
                        pSyncWorker->__pendingRequests.pop_front();
-                       LOG_LOGD("Popping from __pendingRequests, size = %d", pSyncWorker->__pendingRequests.size());
+                       LOG_LOGD("Popping from __pendingRequests, size = %zu", pSyncWorker->__pendingRequests.size());
                        pthread_mutex_unlock(&pSyncWorker->__pendingRequestsMutex);
 
                        pData->pResultListener->OnEventReceived(pData->message);