发布逻辑修复&&日志整改

Signed-off-by: lipengfei <lipengfei53@huawei.com>
This commit is contained in:
lipengfei 2023-12-27 10:16:30 +08:00
parent bfcbdd5583
commit d456b98377
3 changed files with 6 additions and 2 deletions

View File

@ -61,7 +61,10 @@ private:
#define BGTASK_PRINT_LOG(LEVEL, Level, fmt, ...) \
if (BackgroundTaskMgr::BgTaskMgrLogWrapper::JudgeLevel(BackgroundTaskMgr::BgTaskMgrLogLevel::LEVEL)) \
OHOS::HiviewDFX::HiLog::Level(BackgroundTaskMgr::BGTASK_MGR_LABEL, \
fmt, \
"[%{public}s(%{public}s):%{public}d] " fmt, \
OHOS::BackgroundTaskMgr::BgTaskMgrLogWrapper::GetBriefFileName(__FILE__).c_str(), \
__FUNCTION__, \
__LINE__, \
##__VA_ARGS__)
#define BGTASK_LOGD(fmt, ...) BGTASK_PRINT_LOG(DEBUG, Debug, fmt, ##__VA_ARGS__)

View File

@ -75,6 +75,7 @@ void BackgroundTaskMgrService::PublishIfReady()
if (handler_) {
handler_->PostTask(task, DELAY_TIME);
}
return;
}
if (!Publish(DelayedSingleton<BackgroundTaskMgrService>::GetInstance().get())) {
BGTASK_LOGE("Service start failed!");

View File

@ -732,7 +732,7 @@ bool BgEfficiencyResourcesMgr::RemoveTargetResourceRecord(std::unordered_map<int
auto callbackInfo = std::make_shared<ResourceCallbackInfo>(iter->second->GetUid(),
iter->second->GetPid(), eraseBit, iter->second->GetBundleName());
BGTASK_LOGI("remove record from info map, mapkey %{public}d, uid: %{public}d, bundle name: %{public}s"
"erasebit %{public}d", mapKey, callbackInfo->GetUid(), callbackInfo->GetBundleName().c_str(), eraseBit);
" erasebit %{public}d", mapKey, callbackInfo->GetUid(), callbackInfo->GetBundleName().c_str(), eraseBit);
subscriberMgr_->OnResourceChanged(callbackInfo, type);
if (iter->second->resourceNumber_ == 0) {
infoMap.erase(iter);