diff --git a/services/src/auth_res_manager.cpp b/services/src/auth_res_manager.cpp index 3e4b1fbe64ae310d776ce4aa3577478241f245cf..97c932d8a83db782319c17c9c32298402bc3980a 100644 --- a/services/src/auth_res_manager.cpp +++ b/services/src/auth_res_manager.cpp @@ -65,7 +65,7 @@ uint64_t AuthResManager::Register(std::shared_ptr executorInfo, sptr messenger = new UserIAM::AuthResPool::ExecutorMessenger(&coAuthResPool_); callback->OnMessengerReady(messenger); - COAUTH_HILOGD(MODULE_SERVICE, "register is successfull, exeID is XXXX%{public}04" PRIx64, executorId); + COAUTH_HILOGD(MODULE_SERVICE, "register is successfull, exeID is XXXX%{public}04" PRIx64, g_mask & executorId); return executorId; } diff --git a/services/src/auth_res_pool.cpp b/services/src/auth_res_pool.cpp index b4843c037184f17a9af792d1d633151bc29dc4c9..7e12f43a266ebe5c4dd861605b1a07104ff22ad8 100644 --- a/services/src/auth_res_pool.cpp +++ b/services/src/auth_res_pool.cpp @@ -94,7 +94,7 @@ int32_t AuthResPool::DeleteExecutorCallback(uint64_t executorID) return FAIL; } authResPool_.erase(iter); - COAUTH_HILOGI(MODULE_SERVICE, "delete executor callback XXXX%{public}" PRIx64 " success", executorID); + COAUTH_HILOGI(MODULE_SERVICE, "delete executor callback XXXX%{public}" PRIx64 " success", g_mask & executorID); return SUCCESS; } diff --git a/services/src/call_monitor.cpp b/services/src/call_monitor.cpp index eba46450e98e331b5051b2336427eff4bf9d0381..9e9fb80c12df76348fe0ed8f503ae73f9af6f543 100644 --- a/services/src/call_monitor.cpp +++ b/services/src/call_monitor.cpp @@ -16,6 +16,7 @@ #include "call_monitor.h" #include "inner_event.h" #include "event_runner.h" +#include namespace OHOS { namespace UserIAM { @@ -40,7 +41,7 @@ void CallMonitor::MonitorCall(int64_t waitTime, uint64_t scheduleId, Callback &t return; } std::string name = std::to_string(scheduleId); - COAUTH_HILOGI(MODULE_SERVICE, "CallMonitor MonitorCall is called, name is %{public}s", name.c_str()); + COAUTH_HILOGI(MODULE_SERVICE, "CallMonitor MonitorCall is called, name is %{public}04" PRIx64,g_mask & scheduleId); eventHandler_->PostHighPriorityTask(timeoutFun, name, waitTime); } @@ -51,7 +52,7 @@ void CallMonitor::MonitorRemoveCall(uint64_t scheduleId) return; } std::string name = std::to_string(scheduleId); - COAUTH_HILOGI(MODULE_SERVICE, "CallMonitor MonitorRemoveCall is called, name is %{public}s", name.c_str()); + COAUTH_HILOGI(MODULE_SERVICE, "CallMonitor MonitorRemoveCall is called, name is %{public}04" PRIx64,g_mask & scheduleId); eventHandler_->RemoveTask(name); } } // namespace PinAuth diff --git a/services/src/coauth_service.cpp b/services/src/coauth_service.cpp index 85237a063bfc3c621deb1e5fb3ccb697bbf90f53..3410126b868b9992f26daf05110c70e2b8f945d0 100644 --- a/services/src/coauth_service.cpp +++ b/services/src/coauth_service.cpp @@ -106,7 +106,7 @@ uint64_t CoAuthService::Register(std::shared_ptr executorInfo, } uint64_t exeID = authResMgr_.Register(executorInfo, callback); - COAUTH_HILOGD(MODULE_SERVICE, "exeID is XXXX%{public}4" PRIx64, exeID); + COAUTH_HILOGD(MODULE_SERVICE, "exeID is XXXX%{public}4" PRIx64, g_mask & exeID); return exeID; } diff --git a/services/src/coauth_stub.cpp b/services/src/coauth_stub.cpp index 24882100b6e8eea9e98e69498be4b6f944edd92c..a7b6304255e93d5401e13520c02691ceebebd2ee 100644 --- a/services/src/coauth_stub.cpp +++ b/services/src/coauth_stub.cpp @@ -60,7 +60,7 @@ void CoAuthStub::ReadAuthExecutor(AuthResPool::AuthExecutor &executorInfo, Messa uint64_t authAbility = data.ReadUint64(); executorInfo.SetAuthAbility(authAbility); - COAUTH_HILOGD(MODULE_SERVICE, "ReadInt64,authAbility:%{public}" PRIu64, authAbility); + COAUTH_HILOGD(MODULE_SERVICE, "ReadInt64,authAbility:%{public}4" PRIu64, g_mask & authAbility); int32_t executorSecLevel = data.ReadInt32(); executorInfo.SetExecutorSecLevel(static_cast(executorSecLevel)); @@ -118,10 +118,10 @@ int32_t CoAuthStub::BeginScheduleStub(MessageParcel& data, MessageParcel& reply) authInfo.SetPkgName(GetPkgName); uint64_t GetCallerUid = data.ReadUint64(); authInfo.SetCallerUid(GetCallerUid); - COAUTH_HILOGD(MODULE_SERVICE, "ReadUint64,GetCallerUid:%{public}" PRIu64, GetCallerUid); + COAUTH_HILOGD(MODULE_SERVICE, "ReadUint64,GetCallerUid:%{public}4" PRIu64, g_mask & GetCallerUid); uint64_t scheduleId = data.ReadUint64(); - COAUTH_HILOGD(MODULE_SERVICE, "ReadUint64,scheduleId:%{public}" PRIu64, scheduleId); + COAUTH_HILOGD(MODULE_SERVICE, "ReadUint64,scheduleId:%{public}4" PRIu64, g_mask & scheduleId); sptr callback = iface_cast(data.ReadRemoteObject()); if (callback == nullptr) { @@ -139,7 +139,7 @@ int32_t CoAuthStub::CancelStub(MessageParcel& data, MessageParcel& reply) COAUTH_HILOGI(MODULE_SERVICE, "CoAuthStub: CancelStub start"); uint64_t scheduleId = data.ReadUint64(); - COAUTH_HILOGD(MODULE_SERVICE, "ReadUint64 scheduleId:%{public}" PRIu64, scheduleId); + COAUTH_HILOGD(MODULE_SERVICE, "ReadUint64 scheduleId:%{public}4" PRIu64, g_mask & scheduleId); int ret = Cancel(scheduleId); if (!reply.WriteInt32(ret)) { diff --git a/utils/native/include/coauth_hilog_wrapper.h b/utils/native/include/coauth_hilog_wrapper.h index 9524fa785689c7d90a9052b92007f05764bc6faa..ddf11ce0255221677fa3423e95522b5a44a5d801 100644 --- a/utils/native/include/coauth_hilog_wrapper.h +++ b/utils/native/include/coauth_hilog_wrapper.h @@ -18,6 +18,7 @@ #define CONFIG_HILOG #ifdef CONFIG_HILOG + #include "hilog/log.h" namespace OHOS { namespace UserIAM { @@ -78,6 +79,8 @@ static constexpr OHOS::HiviewDFX::HiLogLabel COAUTH_LABEL[COAUTH_MODULE_BUTT] = #define COAUTH_HILOGW(module, ...) (void)OHOS::HiviewDFX::HiLog::Warn(COAUTH_LABEL[module], FORMATTED(__VA_ARGS__)) #define COAUTH_HILOGI(module, ...) (void)OHOS::HiviewDFX::HiLog::Info(COAUTH_LABEL[module], FORMATTED(__VA_ARGS__)) #define COAUTH_HILOGD(module, ...) (void)OHOS::HiviewDFX::HiLog::Debug(COAUTH_LABEL[module], FORMATTED(__VA_ARGS__)) + +const uint64_t g_mask = 0x0000FFFF; } // namespace UserIAM } // namespace OHOS @@ -89,6 +92,12 @@ static constexpr OHOS::HiviewDFX::HiLogLabel COAUTH_LABEL[COAUTH_MODULE_BUTT] = #define COAUTH_HILOGI(...) #define COAUTH_HILOGD(...) +namespace OHOS { +namespace UserIAM { +const uint64_t g_mask = 0x0000FFFF; +} // namespace UserIAM +} // namespace OHOS + #endif // CONFIG_HILOG #endif // COAUTH_HILOG_WRAPPER_H