feat: harden logger lifecycle and add tests

This commit is contained in:
2026-07-13 13:22:10 +08:00
parent 95a8067342
commit 62ed176bdd
8 changed files with 799 additions and 190 deletions
+8 -6
View File
@@ -1,7 +1,9 @@
# 本 pri 用于把 MyLogger 源码直接嵌入 qmake 宿主;不得同时链接 MyLogger 动态库,
# 否则同一进程会拥有两份全局日志状态并争夺 Qt 的唯一消息处理器。
QT += core
CONFIG += c++17
DEFINES += MYLOGGER_STATIC QT_MESSAGELOGCONTEXT
INCLUDEPATH += $$PWD/
#在release下输出debug信息
DEFINES += QT_MESSAGELOGCONTEXT
SOURCES += \
$$PWD/loghandler.cpp
HEADERS += $$PWD/loghandler.h
SOURCES += $$PWD/loghandler.cpp