Pull Request已成功合入, 合并人@纪涛
(感谢 KaiMa 的贡献)Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/MindIE-LLM | ❌ (0/2)(You can also ask: chuyuelin, maoxx241, wu_yushan, yht1024, chenzhinan1212) | ❌ (0/1)(You can also ask: jyoung6652, niushiya, you-zhiyuan-0511, maoxx241, senxiangms) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


Linking Issue Notice
@KaiMa , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .


问题/功能描述
本次PR对项目中的日志系统进行了大规模的统一重构和功能增强。主要解决了项目中日志接口不统一、依赖分散、格式不一致的问题,旨在提升代码的可维护性、可观测性和规范性。具体包括:将多个C++组件原有的自定义 system_log 库替换为统一的 mindie_llm_log 库;将流式日志宏调用(如 LOG_ERROR_LLM <<)更新为函数式宏调用(如 MINDIE_LLM_LOG_ERROR);并引入了动态日志级别管理功能,增强了关键路径(如请求处理、配置管理、通信模块)的调试日志。
修改方案描述
修改方案涉及项目中的CMake构建文件和大量C++源文件。核心内容包括:1) 在CMakeLists.txt中更新链接库依赖,将 system_log 替换为 mindie_llm_log 或 mindie_llm_utils;2) 在源代码中将 #include “system_log.h” 统一替换为 #include “log.h”;3) 将所有旧的 LOG_*_LLM 宏调用更新为对应的 MINDIE_LLM_LOG_* 宏调用,部分配置管理模块的日志则改为使用 std::cout 输出以简化依赖;4) 在日志初始化逻辑中增加了动态日志级别检查器,支持运行时调整日志级别;5) 在多个模块的关键操作点补充了调试和状态日志,以增强系统运行时的可见性。


mindie_llm/text_generator/cpp/sampler/cpu_logits_handler/thread_pool.cppMINDIE_LLM_LOG_ERROR("Init mutext or condition failed");
throw runtime_error("Init mutext or condition failed.");修正拼写错误,将'mutext'改为'mutex'。修改为:
```cpp
MINDIE_LLM_LOG_ERROR("Init mutex or condition failed");
throw runtime_error("Init mutex or condition failed.");
```此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "interNodeTlsCaFiles init error" << std::endl;
恢复使用专用的日志系统(如LOG_ERROR_LLM)进行错误日志记录。如果必须修改,应确保新的日志机制至少提供与原有系统相当的安全性、可靠性和信息完整性。例如,使用一个包装函数,确保日志被写入安全的、受访问控制的审计日志文件中。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "interNodeTlsCaFiles size is invalid" << std::endl;
恢复使用专用的错误日志宏(如LOG_ERROR_LLM)来记录此安全配置错误。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "interNodeTlsCrlFiles init error" << std::endl;
恢复使用专用的错误日志记录此TLS配置错误。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "Failed to get home path" << std::endl;
恢复使用专用的错误日志记录此系统调用失败。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "The size of npuDeviceIds does not equal to modelInstanceNumber" << std::endl;
恢复使用专用的错误日志记录此配置验证错误。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "The size of npuDeviceIds (subset) does not equal to worldSize" << std::endl;
恢复使用专用的错误日志记录此配置验证错误。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "Failed to init tls cfg" << std::endl;
恢复使用专用的错误日志记录TLS初始化失败。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "Failed to init tls cfg. [BackendConfigManager::InitFromJson] " << e.what() << std::endl;
恢复使用专用的错误日志记录此异常,并确保e.what()中的信息不会包含敏感的内部数据结构。可以保留增加的上下文信息([BackendConfigManager::InitFromJson])。
此评论由代码审查工具自动生成


src/config_manager/backend_config.cppstd::cout << "npuDeviceID does not allow repetitive element" << std::endl;
恢复使用专用的错误日志记录此验证失败。注意:原日志信息“npuDeviceID does not allow repetitive element”与代码实际检查的条件(npuDeviceId.size() != backendConfig_.worldSize)不完全匹配,可能是一个错误。建议同时审查此日志信息的准确性。
此评论由代码审查工具自动生成


合入背景
修改内容
资料变更
接口变更
测试结果
CheckList