diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp index 4bada104f53d5f96a04388633dd50e492d6e1abe..92eed3b7a73473d47db23b4958ca8ddcd96ad18f 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_credential.cpp @@ -508,8 +508,8 @@ int32_t AuthCredentialAgreeState::AgreeCredential(DmAuthScope authorizedScope, authContext->accesser.userId : authContext->accessee.userId; std::string selfCredId = authContext->GetCredentialId(DM_AUTH_LOCAL_SIDE, authorizedScope); std::string credId; - LOGI("AuthCredentialAgreeState::AgreeCredential agree with accountId %{public}d and param %{public}s.", - osAccountId, GetAnonyJsonString(authParamsString).c_str()); + LOGI("AuthCredentialAgreeState::AgreeCredential agree with accountId %{public}s and param %{public}s.", + GetAnonyInt32(osAccountId), GetAnonyJsonString(authParamsString).c_str()); int32_t ret = authContext->hiChainAuthConnector->AgreeCredential(osAccountId, selfCredId, authParamsString, credId); if (ret != DM_OK) { diff --git a/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp b/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp index b659af1ad6bbbb4a698c506b6583ff02aeb21386..fa3e60882d346935b717c21328015541bedce5e8 100644 --- a/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp +++ b/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp @@ -500,8 +500,8 @@ int32_t HiChainAuthConnector::GetCredential(std::string &localUdid, int32_t osAc int32_t HiChainAuthConnector::ImportCredential(int32_t osAccountId, int32_t peerOsAccountId, std::string deviceId, std::string publicKey) { - LOGI("start, deviceId: %{public}s, peerOsAccountId: %{public}d", - GetAnonyString(deviceId).c_str(), peerOsAccountId); + LOGI("start, deviceId: %{public}s, peerOsAccountId: %{public}s", + GetAnonyString(deviceId).c_str(), GetAnonyInt32(peerOsAccountId)); JsonObject jsonObj; jsonObj["osAccountId"] = osAccountId; jsonObj["peerOsAccountId"] = peerOsAccountId; diff --git a/services/service/src/devicenamemgr/device_name_manager.cpp b/services/service/src/devicenamemgr/device_name_manager.cpp index 01b689eff46a7a0cf298717377c5e75a52ea070e..f680813df84064ecfccabbfc93ad1a6f31169cc0 100644 --- a/services/service/src/devicenamemgr/device_name_manager.cpp +++ b/services/service/src/devicenamemgr/device_name_manager.cpp @@ -599,7 +599,7 @@ int32_t DeviceNameManager::GetValue(const std::string &tableName, int32_t userId std::string proxyUri = GetProxyUriStr(tableName, userId); auto helper = CreateDataShareHelper(proxyUri); if (helper == nullptr) { - LOGE("helper is nullptr, proxyUri=%{public}s", proxyUri.c_str()); + LOGE("helper is nullptr, proxyUri=%{public}s", GetAnonyString(proxyUri).c_str()); return ERR_DM_POINT_NULL; } std::vector columns = { SETTING_COLUMN_VALUE }; @@ -609,13 +609,15 @@ int32_t DeviceNameManager::GetValue(const std::string &tableName, int32_t userId auto resultSet = helper->Query(uri, predicates, columns); ReleaseDataShareHelper(helper); if (resultSet == nullptr) { - LOGE("Query failed key=%{public}s, proxyUri=%{public}s", key.c_str(), proxyUri.c_str()); + LOGE("Query failed key=%{public}s, proxyUri=%{public}s", key.c_str(), + GetAnonyString(proxyUri).c_str()); return ERR_DM_POINT_NULL; } int32_t count = 0; resultSet->GetRowCount(count); if (count == 0) { - LOGW("no value, key=%{public}s, proxyUri=%{public}s", key.c_str(), proxyUri.c_str()); + LOGW("no value, key=%{public}s, proxyUri=%{public}s", key.c_str(), + GetAnonyString(proxyUri).c_str()); resultSet->Close(); return DM_OK; } @@ -623,12 +625,14 @@ int32_t DeviceNameManager::GetValue(const std::string &tableName, int32_t userId resultSet->GoToRow(index); int32_t ret = resultSet->GetString(index, value); if (ret != DataShare::E_OK) { - LOGE("get value failed, ret=%{public}d, proxyUri=%{public}s", ret, proxyUri.c_str()); + LOGE("get value failed, ret=%{public}d, proxyUri=%{public}s", ret, + GetAnonyString(proxyUri).c_str()); resultSet->Close(); return ret; } resultSet->Close(); - LOGI("proxyUri=%{public}s, value=%{public}s", proxyUri.c_str(), GetAnonyString(value).c_str()); + LOGI("proxyUri=%{public}s, value=%{public}s", GetAnonyString(proxyUri).c_str(), + GetAnonyString(value).c_str()); return DM_OK; } @@ -639,7 +643,7 @@ int32_t DeviceNameManager::SetValue(const std::string &tableName, int32_t userId auto helper = CreateDataShareHelper(proxyUri); if (helper == nullptr) { LOGE("helper is nullptr, proxyUri=%{public}s, value=%{public}s", - proxyUri.c_str(), GetAnonyString(value).c_str()); + GetAnonyString(proxyUri).c_str(), GetAnonyString(value).c_str()); return ERR_DM_POINT_NULL; } DataShare::DataShareValuesBucket val; @@ -651,13 +655,13 @@ int32_t DeviceNameManager::SetValue(const std::string &tableName, int32_t userId int32_t ret = helper->Update(uri, predicates, val); if (ret <= 0) { LOGW("Update failed, ret=%{public}d, proxyUri=%{public}s, value=%{public}s", - ret, proxyUri.c_str(), GetAnonyString(value).c_str()); + ret, GetAnonyString(proxyUri).c_str(), GetAnonyString(value).c_str()); ret = helper->Insert(uri, val); } ReleaseDataShareHelper(helper); if (ret <= 0) { LOGE("set value failed, ret=%{public}d, proxyUri=%{public}s, value=%{public}s", - ret, proxyUri.c_str(), GetAnonyString(value).c_str()); + ret, GetAnonyString(proxyUri).c_str(), GetAnonyString(value).c_str()); return ret; } return ret;