modify:避免多次安装导致日志多个
This commit is contained in:
@@ -81,6 +81,10 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
|
|||||||
// 给Qt安装消息处理函数
|
// 给Qt安装消息处理函数
|
||||||
void LogHandler::installMessageHandler()
|
void LogHandler::installMessageHandler()
|
||||||
{
|
{
|
||||||
|
static bool installFlag = false;
|
||||||
|
if(installFlag)
|
||||||
|
return;
|
||||||
|
installFlag = true;
|
||||||
//获取日期
|
//获取日期
|
||||||
auto _currentDate = QDateTime::currentDateTime().toString("yyyy-MM-dd");
|
auto _currentDate = QDateTime::currentDateTime().toString("yyyy-MM-dd");
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LogHandler(){};
|
LogHandler() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LOGHANDLER_H
|
#endif // LOGHANDLER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user