modify:避免多次安装导致日志多个

This commit is contained in:
TianZD
2026-04-25 21:47:08 +08:00
parent 87059d9b60
commit 772cd663ad
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -81,6 +81,10 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
// 给Qt安装消息处理函数
void LogHandler::installMessageHandler()
{
static bool installFlag = false;
if(installFlag)
return;
installFlag = true;
//获取日期
auto _currentDate = QDateTime::currentDateTime().toString("yyyy-MM-dd");
+1 -1
View File
@@ -15,7 +15,7 @@ public:
}
private:
LogHandler(){};
LogHandler() {};
};
#endif // LOGHANDLER_H