Repository navigation
feat: adapt deepin-debug-config for dynamic log level control (2/3) - #539
Conversation
Reviewer's GuideThis PR adapts ten source files to the shared categorized logging API and updates the log configuration reader for live Sequence diagram for dynamic camera log rule updatessequenceDiagram
participant Env as Environment
participant MLogger
participant DConfig
participant DDLog
participant App as CameraApp
App->>MLogger: MLogger()
MLogger->>Env: read logRules
MLogger->>DConfig: create(org.deepin.camera, org.deepin.camera)
alt DConfig is valid
MLogger->>DConfig: value(log_rules)
DConfig-->>MLogger: log rules
MLogger->>MLogger: appendRules(logRules)
MLogger->>MLogger: setRules(m_rules)
DConfig-->>MLogger: valueChanged(log_rules)
MLogger->>DConfig: value(log_rules)
MLogger->>DDLog: setRules(updated rules)
else DConfig is unavailable
MLogger->>DDLog: setRules(m_rules)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Convert plain qDebug/qInfo/qWarning to categorized qCDebug/qCInfo/qCWarning with org.deepin.camera category in src/src files (closedialog, devnummonitor, exposureslider, filterpreviewbutton, globalutils, gstvideowriter, imageitem, logconfigread, mainwindow, majorimageprocessingthread), and add ddlog.h includes. 将 src/src 下 10 个源文件的普通日志宏改为带 org.deepin.camera 分类的 qCDebug/qCInfo/qCWarning,并补充 ddlog.h 头文件引入。 Log: 适配deepin-debug-config调试模式(2/3) Influence: 可通过deepin-debug-config动态切换deepin-camera的日志输出级别
18364a1 to
ce83276
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['logconfigread.cpp 中 valueChanged 回调调用 setRules(m_config->value(key).toByteArray()) 直接用 DConfig 值替换全部规则,而构造函数中是 appendRules 后再 setRules(m_rules)(合并模式)。两种路径的规则处理方式不一致,建议统一行为,但此为既有逻辑,不影响本次变更正确性。'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['考虑将 using namespace DDLog; 限定在更小作用域内,或直接使用 DDLog::appLog 限定符,以减少命名空间污染风险。'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// logconfigread.cpp - 建议统一 valueChanged 回调中的规则处理方式
// 当前:valueChanged 回调直接替换全部规则
connect(m_config, &DConfig::valueChanged, this, [this](const QString &key) {
if (key == "log_rules") {
// 建议与构造函数一致,使用 appendRules 合并而非直接替换
QByteArray newRules = m_config->value(key).toByteArray();
appendRules(newRules);
setRules(m_rules);
}
});本报告由 AI 代码审查工具自动生成 |
|
/forcemerge |
概要 / Summary
适配 deepin-debug-config 调试模式(第 2 部分,共 3 部分,按每 10 个文件拆分提交)。
qDebug()/qInfo()/qWarning()调用转换为qCDebug/qCInfo/qCWarning(appLog),统一使用org.deepin.camera分类,并补充ddlog.h头文件引入;注释代码保持原样注:本 PR 为拆分提交的第 2 部分,与第 1、3 部分配合使用;文件集与前两部分无交集,无合并冲突。完整改动已整体验证:Qt6 Release 构建通过、四档日志级别实测生效。
Summary by Sourcery
Adapt the second group of camera sources to categorized, dynamically configurable logging.
New Features:
Enhancements: