fix(eventlogger): change event log enable condition from professional-only to non-community#192
Conversation
…-only to non-community 为 EventLogger 事件日志启用条件由仅专业版改为非社区版 PMS: BUG-362029
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR broadens the enablement condition for EventLogger so that event logging is active on all non-community UOS editions instead of only on the professional edition, by updating the logic in the central helper function and its documentation comments. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider whether using a blacklist-style condition (
!= UosCommunity) is future-proof enough; if additional editions are introduced later, you may want an explicit whitelist of enabled editions instead.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider whether using a blacklist-style condition (`!= UosCommunity`) is future-proof enough; if additional editions are introduced later, you may want an explicit whitelist of enabled editions instead.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的 Git Diff。本次修改的核心逻辑是将事件日志的启用策略从“仅限专业版”变更为“除社区版外全部启用”。 以下是我对该代码修改在语法逻辑、代码质量、代码性能和代码安全方面的审查意见及改进建议: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
综合改进后的代码建议基于以上分析,如果你确认“除社区版外全部启用”的业务逻辑无误,我建议对代码进行如下优化(主要针对代码质量和潜在性能问题): namespace DDE_EventLogger {
// Check if event logging should be enabled based on system edition
// Enable for all editions except UosCommunity
inline bool shouldEnableEventLog()
{
// Performance optimization: cache the result to avoid repeated system info queries.
// DSysInfo::uosEditionType() might involve file I/O, so we only evaluate it once.
static const bool enabled = []() {
// Note: DSysInfo is in Dtk::Core namespace
return Dtk::Core::DSysInfo::uosEditionType() != Dtk::Core::DSysInfo::UosCommunity;
}();
return enabled;
}
// Modern C++ type alias instead of typedef
using Initialize = bool(*)(const std::string &package_id, bool enable_sig);
} // namespace DDE_EventLogger改进点说明:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
为 EventLogger 事件日志启用条件由仅专业版改为非社区版
PMS: BUG-362029
Summary by Sourcery
Bug Fixes: