Skip to content

refactor: remove EventLogUtils references from main application and a…#384

Merged
lzwind merged 1 commit intolinuxdeepin:masterfrom
dengzhongyuan365-dev:master
Apr 16, 2026
Merged

refactor: remove EventLogUtils references from main application and a…#384
lzwind merged 1 commit intolinuxdeepin:masterfrom
dengzhongyuan365-dev:master

Conversation

@dengzhongyuan365-dev
Copy link
Copy Markdown
Contributor

…rchive management

  • Removed EventLogUtils logging calls from main.cpp, archivemanager.cpp, and mainwindow.cpp to streamline the codebase.
  • Deleted associated enum values from eventlogutils.h to clean up unused code.

This change simplifies the logging mechanism and reduces dependencies on EventLogUtils.

TASK: https://pms.uniontech.com/task-view-388231.html

…rchive management

- Removed EventLogUtils logging calls from main.cpp, archivemanager.cpp, and mainwindow.cpp to streamline the codebase.
- Deleted associated enum values from eventlogutils.h to clean up unused code.

This change simplifies the logging mechanism and reduces dependencies on EventLogUtils.

TASK: https://pms.uniontech.com/task-view-388231.html
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @dengzhongyuan365-dev, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

lzwind
lzwind previously approved these changes Apr 13, 2026
@dengzhongyuan365-dev
Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

这段代码的变更主要是移除了 EventLogUtils 相关的埋点日志记录代码,包括头文件引用、枚举定义以及各个函数中的日志记录调用。以下是对这段 diff 的审查意见:

1. 语法逻辑

  • 语法正确性:代码的语法没有问题,移除的代码块是完整的,没有留下悬空的括号或未完成的语句。
  • 逻辑完整性:移除日志代码不会影响程序的核心逻辑,因为日志记录通常是辅助功能,不参与业务逻辑的处理。

2. 代码质量

  • 代码清理:移除未使用的代码是良好的实践,可以减少代码冗余,提高可维护性。如果 EventLogUtils 确实不再需要,那么这次清理是合理的。
  • 一致性:移除代码后,确保项目中没有其他地方仍然依赖 EventLogUtils,否则可能会导致编译错误或运行时问题。建议全局搜索 EventLogUtils 的引用,确保没有遗漏。

3. 代码性能

  • 性能提升:移除日志记录可以减少运行时的开销,尤其是在高频调用的函数中(如 loadArchiveextractFiles 等),可以减少 QJsonObject 的构造和 I/O 操作,从而提升性能。

4. 代码安全

  • 安全性:移除日志记录可能会降低系统的可观测性,尤其是在调试或排查问题时。如果日志记录用于安全审计(如记录文件操作),移除后可能会影响安全事件的追溯。
  • 建议:如果日志记录用于安全审计,建议保留关键操作的日志,或者采用更轻量级的日志机制。

5. 改进建议

  • 全局检查:确认 EventLogUtils 在项目中是否完全不再使用。如果仍有其他模块依赖它,建议保留该工具类或迁移到新的日志系统。
  • 日志替代方案:如果日志记录仍然需要,可以考虑使用更高效的日志库(如 spdlogglog),或者将日志记录逻辑集中管理,避免在业务代码中分散处理。
  • 代码注释:如果移除日志是有意为之,建议在提交信息或代码注释中说明原因,以便后续维护者理解。

6. 其他观察

  • 头文件移除:移除 #include "eventlogutils.h" 是正确的,但需要确认没有其他隐式依赖(如通过其他头文件间接引入)。
  • 枚举移除CompressTID 枚举的移除是合理的,但如果其他模块依赖这些枚举值,可能会导致编译错误。

总结

这次代码变更主要是清理不再使用的日志记录代码,整体是合理的。但需要确保:

  1. EventLogUtils 在项目中完全不再使用。
  2. 如果日志记录仍有必要,考虑替代方案。
  3. 在提交信息中说明移除日志的原因,以便团队理解。

如果以上条件都满足,这次变更是安全的,可以合并。

@dengzhongyuan365-dev
Copy link
Copy Markdown
Contributor Author

/forcemerge

@lzwind lzwind merged commit 49cd8f8 into linuxdeepin:master Apr 16, 2026
30 checks passed
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants