diff --git a/services/ans/src/clone/notification_clone_manager.cpp b/services/ans/src/clone/notification_clone_manager.cpp index 1f4d4392a988e0eaa68e81f7e4f3527b80856d19..cbf791a5e9b6d41de09ee9b23097ca36717ac02b 100644 --- a/services/ans/src/clone/notification_clone_manager.cpp +++ b/services/ans/src/clone/notification_clone_manager.cpp @@ -163,7 +163,7 @@ ErrCode NotificationCloneManager::LoadConfig(UniqueFd &fd, std::string& config) close(destFd); std::ifstream fs(BACKUP_CONFIG_FILE_PATH); if (!fs.is_open()) { - ANS_LOGW("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(); @@ -181,13 +181,13 @@ ErrCode NotificationCloneManager::SaveConfig(const std::string& config) RemoveBackUpFile(); FILE* fp = fopen(BACKUP_CONFIG_FILE_PATH, "w"); if (!fp) { - ANS_LOGW("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_LOGW("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 6b685d87d8281544b11a5229ace81eb49d3b165c..7d20b8b54cfea1ee83a4968dbd4db96211187e9a 100644 --- a/services/distributed/src/soft_bus/distributed_publish_service.cpp +++ b/services/distributed/src/soft_bus/distributed_publish_service.cpp @@ -284,7 +284,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 1a7b4b168e2c0f4b0cfb211f73def58b1185df5b..a6e44f7d12c499297f92f42adfebcf5e7578bbea 100644 --- a/services/distributed/src/soft_bus/distributed_subscribe_service.cpp +++ b/services/distributed/src/soft_bus/distributed_subscribe_service.cpp @@ -213,7 +213,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()); @@ -283,7 +284,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()) << ' '; } @@ -298,7 +301,7 @@ void DistributedService::OnBatchCanceled(const std::vector& notific std::string notificationKey = GetNotificationKey(notification); std::function task = std::bind([peerDevice, notification, notificationKey]() { NotificationRemoveBox removeBox; - 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.GetByteBuffer(), removeBox.GetByteLength(),