!1172 hisysevent插件抓取支持对domain和event过滤

Merge pull request !1172 from 集川/master
This commit is contained in:
openharmony_ci 2023-11-15 08:47:19 +00:00 committed by Gitee
commit bcb905f5c8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 12 additions and 1 deletions

View File

@ -58,7 +58,8 @@ int HisyseventPlugin::Start(const uint8_t* configData, uint32_t configSize)
CHECK_TRUE(protoConfig_.ParseFromArray(configData, configSize) > 0, -1,
"NOTE HisyseventPlugin: ParseFromArray failed");
HILOG_DEBUG(LOG_CORE, "NOTE configData ParseFromArray sucessed,sourse data:%s", protoConfig_.msg().c_str());
HILOG_DEBUG(LOG_CORE, "config sourse data:%s domain:%s event:%s", protoConfig_.msg().c_str(),
protoConfig_.subscribe_domain().c_str(), protoConfig_.subscribe_event().c_str());
CHECK_TRUE(InitHisyseventCmd(), -1, "HisyseventPlugin: Init HisyseventCmd failed");
@ -181,6 +182,14 @@ inline bool HisyseventPlugin::InitHisyseventCmd()
fullCmd_.emplace_back("hisysevent"); // exe file name
fullCmd_.emplace_back("-rd");
if (!protoConfig_.subscribe_domain().empty()) {
fullCmd_.emplace_back("-o");
fullCmd_.emplace_back(protoConfig_.subscribe_domain());
}
if (!protoConfig_.subscribe_event().empty()) {
fullCmd_.emplace_back("-n");
fullCmd_.emplace_back(protoConfig_.subscribe_event());
}
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
return true;
}

View File

@ -17,4 +17,6 @@ option optimize_for = LITE_RUNTIME;
// TODO Save the fetch data
message HisyseventConfig {
string msg = 1;
string subscribe_domain = 2;
string subscribe_event = 3;
}