diff --git a/services/distributeddataservice/service/data_share/common/kv_delegate.cpp b/services/distributeddataservice/service/data_share/common/kv_delegate.cpp index 1c2375d436fc28151aa10bed469093ab6922e147..d9f4d194c0a7f093cd4088eb2aeb298c64459ebb 100644 --- a/services/distributeddataservice/service/data_share/common/kv_delegate.cpp +++ b/services/distributeddataservice/service/data_share/common/kv_delegate.cpp @@ -282,7 +282,7 @@ std::pair KvDelegate::Upsert(const std::string &collectionName int version = -1; if (GetVersion(collectionName, id, version)) { if (value.GetVersion() <= version) { - ZLOGE("GetVersion failed,%{public}s id %{private}s %{public}d %{public}d", collectionName.c_str(), + ZLOGE("GetVersion failed,%{public}s id %{public}s %{public}d %{public}d", collectionName.c_str(), id.c_str(), value.GetVersion(), version); return std::make_pair(E_VERSION_NOT_NEWER, 0); } diff --git a/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp b/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp index 18a7b53638bba26d8af0210612673f6166ae8932..8a9988e0c401e94e7e8333b63500074246cc894a 100644 --- a/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp +++ b/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp @@ -337,7 +337,7 @@ int32_t PublishedProxyData::Delete(const std::string &uri, const BundleInfo &cal ProxyDataNode oldData; if (!ProxyDataNode::Unmarshall(queryResult, oldData)) { - ZLOGE("Unmarshall failed, %{private}s", queryResult.c_str()); + ZLOGE("Unmarshall failed, %{public}s", StringUtils::GeneralAnonymous(queryResult).c_str()); return INNER_ERROR; } if (callerBundleInfo.tokenId != oldData.tokenId) { diff --git a/services/distributeddataservice/service/data_share/common/rdb_delegate.cpp b/services/distributeddataservice/service/data_share/common/rdb_delegate.cpp index 940f599c448413ab291344275d46ff19207f4951..2edad984d468c517a0ede1053320ece226cfc9e4 100644 --- a/services/distributeddataservice/service/data_share/common/rdb_delegate.cpp +++ b/services/distributeddataservice/service/data_share/common/rdb_delegate.cpp @@ -31,6 +31,7 @@ #include "scheduler_manager.h" #include "string_wrapper.h" #include "utils/anonymous.h" +#include "utils.h" #include "want_params.h" #include "db_delegate.h" #include "log_debug.h" @@ -298,7 +299,7 @@ std::string RdbDelegate::Query(const std::string &sql, const std::vectorQueryByStep(sql, selectionArgs); if (resultSet == nullptr) { - ZLOGE("Query failed %{private}s", sql.c_str()); + ZLOGE("Query failed %{public}s", StringUtils::GeneralAnonymous(sql).c_str()); return ""; } int rowCount; @@ -318,7 +319,7 @@ std::shared_ptr RdbDelegate::QuerySql(const std::string &s } auto resultSet = store_->QuerySql(sql); if (resultSet == nullptr) { - ZLOGE("Query failed %{private}s", sql.c_str()); + ZLOGE("Query failed %{public}s", StringUtils::GeneralAnonymous(sql).c_str()); return resultSet; } int rowCount; @@ -375,4 +376,4 @@ bool RdbDelegate::IsLimit(int count, int32_t callingPid, uint32_t callingTokenId HiViewFaultAdapter::ReportDataFault(faultInfo); return true; } -} // namespace OHOS::DataShare \ No newline at end of file +} // namespace OHOS::DataShare diff --git a/services/distributeddataservice/service/data_share/common/scheduler_manager.cpp b/services/distributeddataservice/service/data_share/common/scheduler_manager.cpp index fa7ec6a969581674ccc00a3ed10535173db59c8d..d8a87a67db954a61d92b3825f7e60b3f74f67627 100644 --- a/services/distributeddataservice/service/data_share/common/scheduler_manager.cpp +++ b/services/distributeddataservice/service/data_share/common/scheduler_manager.cpp @@ -209,14 +209,14 @@ void SchedulerManager::SetTimer( duration, key.subscriberId, key.bundleName.c_str()); auto it = timerCache_.find(key); if (it != timerCache_.end()) { - ZLOGD_MACRO("has current taskId: %{private}s, subscriberId is %{public}" PRId64 ", bundleName is %{public}s", + ZLOGD_MACRO("has current taskId: %{public}s, subscriberId is %{public}" PRId64 ", bundleName is %{public}s", URIUtils::Anonymous(key.uri).c_str(), key.subscriberId, key.bundleName.c_str()); auto timerId = it->second; ResetTimerTask(timerId, reminderTime); return; } auto callback = [key, metaData, userId, this]() { - ZLOGI("schedule notify start, uri is %{private}s, subscriberId is %{public}" PRId64 ", bundleName is " + ZLOGI("schedule notify start, uri is %{public}s, subscriberId is %{public}" PRId64 ", bundleName is " "%{public}s", URIUtils::Anonymous(key.uri).c_str(), key.subscriberId, key.bundleName.c_str()); int64_t timerId = EraseTimerTaskId(key); diff --git a/services/distributeddataservice/service/data_share/data/template_data.cpp b/services/distributeddataservice/service/data_share/data/template_data.cpp index 79219aedefc4cb40bb85498c80b35a826049e236..af7bbb26ea18202f8f68a1fbcfd83b86942a7b78 100644 --- a/services/distributeddataservice/service/data_share/data/template_data.cpp +++ b/services/distributeddataservice/service/data_share/data/template_data.cpp @@ -15,6 +15,8 @@ #define LOG_TAG "TemplateData" #include "template_data.h" #include "log_print.h" +#include "utils.h" + namespace OHOS::DataShare { bool TemplateNode::Marshal(DistributedData::Serializable::json &node) const { @@ -121,7 +123,7 @@ int32_t TemplateData::Query(const std::string &filter, Template &aTemplate) } TemplateRootNode data; if (!DistributedData::Serializable::Unmarshall(queryResult, data)) { - ZLOGE("Unmarshall failed, %{private}s", queryResult.c_str()); + ZLOGE("Unmarshall failed, %{public}s", StringUtils::GeneralAnonymous(queryResult).c_str()); return E_ERROR; } aTemplate = data.ToTemplate(); @@ -207,4 +209,4 @@ bool PredicatesNode::Unmarshal(const DistributedData::Serializable::json &node) ret = ret && GetValue(node, GET_NAME(selectSql), selectSql); return ret; } -} // namespace OHOS::DataShare \ No newline at end of file +} // namespace OHOS::DataShare diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp index 0b3e7c81b499d48ccdcf57dac0174ae10c8379ca..5e0e589ad64ba1e993c75b66f15ec618123a7d99 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp @@ -262,9 +262,9 @@ int32_t DataShareServiceImpl::AddTemplate(const std::string &uri, const int64_t ZLOGE("get bundleName error, %{public}s", URIUtils::Anonymous(uri).c_str()); return ERROR; } - ZLOGI("Add template, uri %{private}s, subscriberId %{public}" PRIi64 ", bundleName %{public}s," + ZLOGI("Add template, uri %{public}s, subscriberId %{public}" PRIi64 ", bundleName %{public}s," "predicates size %{public}zu.", - uri.c_str(), subscriberId, tpltId.bundleName_.c_str(), tplt.predicates_.size()); + URIUtils::Anonymous(uri).c_str(), subscriberId, tpltId.bundleName_.c_str(), tplt.predicates_.size()); return templateStrategy_.Execute(context, [&uri, &tpltId, &tplt, &context]() -> int32_t { auto result = TemplateManager::GetInstance().Add( Key(uri, tpltId.subscriberId_, tpltId.bundleName_), context->visitedUserId, tplt); @@ -282,7 +282,7 @@ int32_t DataShareServiceImpl::DelTemplate(const std::string &uri, const int64_t ZLOGE("get bundleName error, %{public}s", URIUtils::Anonymous(uri).c_str()); return ERROR; } - ZLOGI("Delete template, uri %{private}s, subscriberId %{public}" PRIi64 ", bundleName %{public}s.", + ZLOGI("Delete template, uri %{public}s, subscriberId %{public}" PRIi64 ", bundleName %{public}s.", URIUtils::Anonymous(uri).c_str(), subscriberId, tpltId.bundleName_.c_str()); return templateStrategy_.Execute(context, [&uri, &tpltId, &context]() -> int32_t { return TemplateManager::GetInstance().Delete( @@ -871,15 +871,15 @@ int32_t DataShareServiceImpl::OnAppUpdate(const std::string &bundleName, int32_t void DataShareServiceImpl::NotifyObserver(const std::string &uri) { auto anonymous = URIUtils::Anonymous(uri); - ZLOGD_MACRO("%{private}s try notified", anonymous.c_str()); + ZLOGD_MACRO("%{public}s try notified", anonymous.c_str()); auto context = std::make_shared(uri); if (!GetCallerBundleName(context->callerBundleName)) { - ZLOGE("get bundleName error, %{private}s", anonymous.c_str()); + ZLOGE("get bundleName error, %{public}s", anonymous.c_str()); return; } auto ret = rdbNotifyStrategy_.Execute(context); if (ret) { - ZLOGI("%{private}s start notified", anonymous.c_str()); + ZLOGI("%{public}s start notified", anonymous.c_str()); RdbSubscriberManager::GetInstance().Emit(uri, context); } }