diff --git a/services/ans/src/clone/notification_clone_manager.cpp b/services/ans/src/clone/notification_clone_manager.cpp index a9b3a5f78dbf667a618b67fb9854019331073e63..d2bde8c4c014160c8b25d4b1fc8105ed87f925f5 100644 --- a/services/ans/src/clone/notification_clone_manager.cpp +++ b/services/ans/src/clone/notification_clone_manager.cpp @@ -235,7 +235,7 @@ ErrCode NotificationCloneManager::LoadConfig(UniqueFd &fd, std::string& config) fdsan_close_with_tag(destFd, NOTIFICATION_FDSAN_TAG); std::ifstream fs(BACKUP_CONFIG_FILE_PATH); if (!fs.is_open()) { - ANS_LOGE("Loading config file%{public}s is_open() failed!", BACKUP_CONFIG_FILE_PATH); + ANS_LOGE("Loading config file is_open() failed!"); return ANS_CLONE_ERROR; } config.clear(); @@ -253,13 +253,13 @@ ErrCode NotificationCloneManager::SaveConfig(const std::string& config) RemoveBackUpFile(); FILE* fp = fopen(BACKUP_CONFIG_FILE_PATH, "w"); if (!fp) { - ANS_LOGE("Save config file: %{public}s, fopen() failed!", BACKUP_CONFIG_FILE_PATH); + ANS_LOGE("Save config file fopen() failed!"); return ANS_CLONE_ERROR; } int ret = static_cast(fwrite(config.c_str(), 1, config.length(), fp)); if (ret != (int)config.length()) { - ANS_LOGE("Save config file: %{public}s, fwrite %{public}d failed!", BACKUP_CONFIG_FILE_PATH, ret); + ANS_LOGE("Save config file, fwrite %{public}d failed!", ret); } (void)fflush(fp); (void)fsync(fileno(fp)); diff --git a/services/distributed/src/soft_bus/distributed_publish_service.cpp b/services/distributed/src/soft_bus/distributed_publish_service.cpp index 60879db2d65b4f1b2e674d5e3d95d605b339028d..47abc88b1c826b58cb4bbbdf6d053eb0a434ed21 100644 --- a/services/distributed/src/soft_bus/distributed_publish_service.cpp +++ b/services/distributed/src/soft_bus/distributed_publish_service.cpp @@ -277,7 +277,7 @@ void DistributedService::PublishNotifictaion(const std::shared_ptr& boxM MakeNotifictaionIcon(requestBox, request, isCommonLiveView); MakeNotifictaionReminderFlag(requestBox, request); int result = IN_PROCESS_CALL(NotificationHelper::PublishNotification(*request)); - ANS_LOGI("Dans publish message %{public}s %{public}d.", request->Dump().c_str(), result); + ANS_LOGD("Dans publish result = %{public}d.", result); } void DistributedService::RemoveNotification(const std::shared_ptr& boxMessage) diff --git a/services/distributed/src/soft_bus/distributed_subscribe_service.cpp b/services/distributed/src/soft_bus/distributed_subscribe_service.cpp index 0cec6cae7be9952e8ef23f3fce37b445696cfde1..01f5a9c4fb4351857babf40ffba7a52f90c21e41 100644 --- a/services/distributed/src/soft_bus/distributed_subscribe_service.cpp +++ b/services/distributed/src/soft_bus/distributed_subscribe_service.cpp @@ -218,7 +218,8 @@ void DistributedService::SendNotifictionRequest(const std::shared_ptrGetNotificationRequestPoint(); - ANS_LOGI("Dans OnConsumed %{public}s", requestPoint->Dump().c_str()); + ANS_LOGI("Dans OnConsumed Notification key = %{public}s, notificationFlag = %{public}s", request->GetKey().c_str(), + requestPoint->GetFlags() == nullptr ? "null" : requestPoint->GetFlags()->Dump().c_str()); requestBox->SetAutoDeleteTime(requestPoint->GetAutoDeletedTime()); requestBox->SetFinishTime(requestPoint->GetFinishDeadLine()); requestBox->SetNotificationHashCode(request->GetKey()); @@ -287,7 +288,9 @@ void DistributedService::OnBatchCanceled(const std::vectorDump().c_str()); + auto notificationFlags = notification->GetNotificationRequestPoint()->GetFlags(); + ANS_LOGI("Dans OnConsumed Notification key = %{public}s, notificationFlag = %{public}s", notification->GetKey().c_str(), + notificationFlags == nullptr ? "null" : notificationFlags->Dump().c_str()); keysStream << GetNotificationKey(notification) << ' '; slotTypesStream << std::to_string(notification->GetNotificationRequestPoint()->GetSlotType()) << ' '; } @@ -302,7 +305,7 @@ void DistributedService::OnBatchCanceled(const std::vectorSetNotificationSlotTypes(slotTypes); if (!batchRemoveBox->Serialize()) { - ANS_LOGW("dans OnCanceled serialize failed"); + ANS_LOGW("Dans OnCanceled serialize failed"); return; } DistributedClient::GetInstance().SendMessage(batchRemoveBox, TransDataType::DATA_TYPE_MESSAGE, @@ -325,11 +328,13 @@ void DistributedService::OnCanceled(const std::shared_ptr& notific std::string notificationKey = GetNotificationKey(notification); std::function task = std::bind([peerDevice, notification, notificationKey]() { std::shared_ptr removeBox = std::make_shared(); - ANS_LOGI("dans OnCanceled %{public}s", notification->Dump().c_str()); + auto notificationFlags = notification->GetNotificationRequestPoint()->GetFlags(); + ANS_LOGI("Dans OnCanceled Notification key = %{public}s, notificationFlag = %{public}s", notification->GetKey().c_str(), + notificationFlags == nullptr ? "null" : notificationFlags->Dump().c_str()); removeBox->SetNotificationHashCode(notificationKey); removeBox->setNotificationSlotType(notification->GetNotificationRequestPoint()->GetSlotType()); if (!removeBox->Serialize()) { - ANS_LOGW("dans OnCanceled serialize failed"); + ANS_LOGW("Dans OnCanceled serialize failed"); return; } DistributedClient::GetInstance().SendMessage(removeBox, TransDataType::DATA_TYPE_MESSAGE,