fix: use second-level log timestamps

This commit is contained in:
2026-07-14 08:50:44 +08:00
parent 62ed176bdd
commit b41d744965
3 changed files with 25 additions and 15 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ MyLogger 是用于 Qt 程序的进程级日志模块,接管 `qDebug()`、`qInf
## 行为
- 默认写入 `{applicationDirPath}/logs`,日志文件名为 `yyyy-MM-dd_进程号_分卷号.log`
- 默认写入 `{applicationDirPath}/logs`,日志文件名为 `yyyy-MM-dd_hhmmss_分卷号.log`,例如 `2026-07-14_153045_001.log`
- 单个文件最大 10 MiB,达到上限自动创建下一个分卷;仅清理本模块生成且超过 30 天的日志。
- 普通日志最多每秒 flush 一次;`qCritical()``qFatal()` 会立即 flush。
- 安装时保存此前的 Qt 消息处理器,卸载时恢复它。Qt 每个进程只能有一个全局消息处理器,安装期间不要由其他模块再次调用 `qInstallMessageHandler()`