dde-file-manager
dde-file-manager copied to clipboard
chore: update logging category usage in encrypt manager
- Reintroduced the logging category for the encrypt manager in both the header and implementation files to ensure consistent logging practices.
- This change enhances the visibility of operations within the encrypt manager, aiding in debugging and monitoring.
Log: This commit updates the logging category usage in the encrypt manager, improving logging consistency and clarity.
Summary by Sourcery
Reintroduce and register the encryption manager logging category to ensure consistent and clear logging for debugging and monitoring.
Enhancements:
- Re-add DFM_LOG_USE_CATEGORY in encrypt_manager_global.h for the encrypt manager namespace
- Register the DPENCRYPTMANAGER_NAMESPACE logging category in encryptmanager.cpp
Reviewer's Guide
Refines logging macros, restores encrypt manager’s logging category, and standardizes macro usage across preview, plugin, and service modules by replacing legacy calls with the corrected registration macro.
Class diagram for logging macro usage in encrypt manager
classDiagram
class EncryptManager {
+void initialize()
<<uses>> QLoggingCategory
}
class QLoggingCategory
EncryptManager -- QLoggingCategory : uses
note for EncryptManager "DFM_LOG_REGISTER_CATEGORY(DPENCRYPTMANAGER_NAMESPACE) is now used to register logging category."
Class diagram for logging macro definitions and usage
classDiagram
class DFM_LOG_REGISTER_CATEGORY {
<<macro>>
+registers a QLoggingCategory for a namespace
}
class DFM_LOG_USE_CATEGORY {
<<macro>>
+enables use of registered logging category in a namespace
}
class QLoggingCategory
DFM_LOG_REGISTER_CATEGORY ..> QLoggingCategory : registers
DFM_LOG_USE_CATEGORY ..> QLoggingCategory : uses
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Refine and correct logging macro definitions in the core log defines |
|
include/dfm-base/dfm_log_defines.h |
| Reintroduce and register the encrypt manager logging category |
|
src/plugins/filemanager/dfmplugin-encrypt-manager/encrypt_manager_global.hsrc/plugins/filemanager/dfmplugin-encrypt-manager/encryptmanager.cpp |
| Bulk replace legacy logging macro calls across preview, plugin, and service modules |
|
src/apps/dde-file-manager-preview/filepreview/previewlibrary.cppsrc/apps/dde-file-manager-preview/libdfm-preview/filepreview.cppsrc/apps/dde-file-manager-preview/pluginpreviews/dciicon-preview/ddciiconpreview.cppsrc/apps/dde-file-manager-preview/pluginpreviews/image-preview/imagepreviewplugin.cppsrc/apps/dde-file-manager-preview/pluginpreviews/music-preview/musicpreviewplugin.cppsrc/apps/dde-file-manager-preview/pluginpreviews/pdf-preview/pdfpreviewplugin.cppsrc/apps/dde-file-manager-preview/pluginpreviews/text-preview/textpreviewplugin.cppsrc/apps/dde-file-manager-preview/pluginpreviews/video-preview/videopreviewplugin.cppsrc/plugins/common/dfmplugin-bookmark/bookmark.cppsrc/plugins/common/dfmplugin-burn/burn.cppsrc/plugins/common/dfmplugin-dirshare/dirshare.cppsrc/plugins/common/dfmplugin-emblem/emblem.cppsrc/plugins/common/dfmplugin-fileoperations/fileoperations.cppsrc/plugins/common/dfmplugin-menu/menu.cppsrc/plugins/common/dfmplugin-propertydialog/propertydialog.cppsrc/plugins/common/dfmplugin-tag/tag.cppsrc/plugins/common/dfmplugin-trashcore/trashcore.cppsrc/plugins/common/dfmplugin-utils/utils.cppsrc/plugins/daemon/core/core.cppsrc/plugins/daemon/core/devicemanagerdbus.cppsrc/plugins/daemon/filemanager1/filemanager1.cppsrc/plugins/daemon/recent/recentdaemon.cppsrc/plugins/daemon/tag/tagdaemon.cppsrc/plugins/daemon/vault/vaultdaemon.cppsrc/plugins/desktop/ddplugin-background/backgroundplugin.cppsrc/plugins/desktop/ddplugin-canvas/canvasplugin.cppsrc/plugins/desktop/ddplugin-core/core.cppsrc/plugins/desktop/ddplugin-organizer/organizerplugin.cppsrc/plugins/desktop/ddplugin-wallpapersetting/settingsdbusinterface.cppsrc/plugins/filedialog/core/core.cppsrc/plugins/filemanager/dfmplugin-avfsbrowser/avfsbrowser.cppsrc/plugins/filemanager/dfmplugin-computer/computer.cppsrc/plugins/filemanager/dfmplugin-core/core.cppsrc/plugins/filemanager/dfmplugin-detailspace/detailspace.cppsrc/plugins/filemanager/dfmplugin-myshares/myshares.cppsrc/plugins/filemanager/dfmplugin-optical/optical.cppsrc/plugins/filemanager/dfmplugin-recent/recent.cppsrc/plugins/filemanager/dfmplugin-search/search.cppsrc/plugins/filemanager/dfmplugin-sidebar/sidebar.cppsrc/plugins/filemanager/dfmplugin-smbbrowser/smbbrowser.cppsrc/plugins/filemanager/dfmplugin-titlebar/titlebar.cppsrc/plugins/filemanager/dfmplugin-trash/trash.cppsrc/plugins/filemanager/dfmplugin-vault/vault.cppsrc/plugins/filemanager/dfmplugin-workspace/workspace.cppsrc/services/accesscontrol/accesscontroldbus.cppsrc/services/mountcontrol/mountcontroldbus.cppsrc/services/sharecontrol/sharecontroldbus.cppsrc/services/textindex/textindexdbus.cpp |
| Clean up obsolete logging comments and formatting in the preview application |
|
src/apps/dde-file-manager-preview/filepreview/previewsingleapplication.cpp |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Johnson-zs
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
deepin pr auto review
代码审查意见:
-
在
dfm_log_defines.h文件中,DFM_LOG_REISGER_CATEGORY宏被重命名为DFM_LOG_REGISTER_CATEGORY,但是DFM_LOG_REISGER_CATEGORY宏的定义仍然存在,可能会导致混淆。建议删除或重命名DFM_LOG_REISGER_CATEGORY宏的定义,以避免潜在的混淆。 -
在
previewlibrary.cpp、previewsingleapplication.cpp、filepreview.cpp、ddciiconpreview.cpp、imagepreviewplugin.cpp、musicpreviewplugin.cpp、pdfpreviewplugin.cpp、textpreviewplugin.cpp、videopreviewplugin.cpp、bookmark.cpp、burn.cpp、dirshare.cpp、emblem.cpp、fileoperations.cpp、menu.cpp、propertydialog.cpp、tag.cpp、trashcore.cpp、utils.cpp、core.cpp、devicemanagerdbus.cpp、filemanager1.cpp、recentdaemon.cpp、tagdaemon.cpp、vaultdaemon.cpp、backgroundplugin.cpp、canvasplugin.cpp、core.cpp、organizerplugin.cpp、settingsdbusinterface.cpp、core.cpp、avfsbrowser.cpp、computer.cpp、core.cpp、detailspace.cpp、encrypt_manager_global.h、encryptmanager.cpp、myshares.cpp、optical.cpp、recent.cpp、search.cpp、sidebar.cpp、smbbrowser.cpp、titlebar.cpp、trash.cpp、vault.cpp、workspace.cpp、accesscontroldbus.cpp、mountcontroldbus.cpp、sharecontroldbus.cpp、textindexdbus.cpp等文件中,DFM_LOG_REISGER_CATEGORY宏被替换为DFM_LOG_REGISTER_CATEGORY。建议检查这些文件,确保所有使用DFM_LOG_REISGER_CATEGORY宏的地方都已经更新为DFM_LOG_REGISTER_CATEGORY,以保持代码的一致性。 -
在
encrypt_manager_global.h文件中,DFM_LOG_USE_CATEGORY宏被移动到了文件末尾,这可能会导致编译错误,因为DFM_LOG_USE_CATEGORY宏在文件的其他地方被使用。建议将DFM_LOG_USE_CATEGORY宏的声明和定义移动到文件的开头,或者确保在使用DFM_LOG_USE_CATEGORY宏之前已经包含了相应的头文件。 -
在
encryptmanager.cpp文件中,DFM_LOG_REGISTER_CATEGORY宏被添加,但是没有看到对应的#include语句。建议在文件开头添加#include "dfm_log_defines.h",以确保DFM_LOG_REGISTER_CATEGORY宏可以被正确解析。 -
在
encryptmanager.cpp文件中,EncryptManager::initialize函数的实现中,没有看到对initialize函数的具体实现。建议检查initialize函数的实现,确保它正确地初始化了EncryptManager类。 -
在
encryptmanager.cpp文件中,EncryptManager::initialize函数的实现中,没有看到对initialize函数的注释。建议添加注释,说明initialize函数的作用和实现细节。 -
在
encryptmanager.cpp文件中,EncryptManager::initialize函数的实现中,没有看到对initialize函数的异常处理。建议添加异常处理,以确保在初始化过程中出现错误时能够正确处理。 -
在
encryptmanager.cpp文件中,EncryptManager::initialize函数的实现中,没有看到对initialize函数的性能优化。建议检查initialize函数的实现,确保它没有性能瓶颈。 -
在
encryptmanager.cpp文件中,EncryptManager::initialize函数的实现中,没有看到对initialize函数的代码质量检查。建议使用代码质量检查工具,如clang-tidy,来检查initialize函数的代码质量。 -
在
encryptmanager.cpp文件中,EncryptManager::initialize函数的实现中,没有看到对initialize函数的单元测试。建议编写单元测试,以确保initialize函数的正确性和稳定性。
@sourcery-ai review
/forcemerge
This pr force merged! (status: blocked)