!42441 【mediaQuery】添加维测日志

Merge pull request !42441 from 冯纪拓/mq_log
This commit is contained in:
openharmony_ci 2024-09-04 09:16:53 +00:00 committed by Gitee
commit 9effb4663e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 9 additions and 0 deletions

View File

@ -126,6 +126,7 @@ const std::unordered_map<AceLogTag, const char*> g_DOMAIN_CONTENTS_MAP = {
{ AceLogTag::ACE_CLIPBOARD, "AceClipBoard"},
{ AceLogTag::ACE_SECURITY_COMPONENT, "AceSecurityComponent"},
{ AceLogTag::ACE_LAYOUT_INSPECTOR, "AceLayoutInspector" },
{ AceLogTag::ACE_MEDIA_QUERY, "AceMediaQuery" },
};
// initial static member object
LogLevel LogWrapper::level_ = LogLevel::DEBUG;

View File

@ -203,6 +203,7 @@ enum AceLogTag : uint8_t {
ACE_VISUAL_EFFECT, // C03955
ACE_SECURITY_COMPONENT, // C03956
ACE_LAYOUT_INSPECTOR, // C03957
ACE_MEDIA_QUERY, // C03958
FORM_RENDER = 255, // C039FF FormRenderer, last domain, do not add
};

View File

@ -68,6 +68,7 @@ public:
{
{
std::lock_guard<std::mutex> lock(mutex_);
TAG_LOGI(AceLogTag::ACE_MEDIA_QUERY, "clean:%{public}s", media_.c_str());
CleanListenerSet();
}
@ -132,6 +133,8 @@ public:
if (delayDeleteCallbacks_->find(cbRef) != delayDeleteCallbacks_->end()) {
continue;
}
TAG_LOGI(AceLogTag::ACE_MEDIA_QUERY, "trigger:%{public}s matches:%{public}d",
listener->media_.c_str(), listener->matches_);
napi_handle_scope scope = nullptr;
napi_open_handle_scope(listener->env_, &scope);
if (scope == nullptr) {
@ -182,6 +185,8 @@ public:
napi_ref ref = nullptr;
napi_create_reference(env, cb, 1, &ref);
listener->cbList_.emplace_back(ref);
TAG_LOGI(AceLogTag::ACE_MEDIA_QUERY, "on:%{public}s num=%{public}d", listener->media_.c_str(),
static_cast<int>(listener->cbList_.size()));
napi_close_handle_scope(env, scope);
#if defined(PREVIEW)
@ -225,6 +230,8 @@ public:
listener->cbList_.erase(iter);
}
}
TAG_LOGI(AceLogTag::ACE_MEDIA_QUERY, "off:%{public}s num=%{public}d", listener->media_.c_str(),
static_cast<int>(listener->cbList_.size()));
return nullptr;
}