|
|
@ -67,7 +67,18 @@ void LogHandler::installMessageHandler() |
|
|
|
QDir _logDir(_logDirPath); |
|
|
|
if(!_logDir.exists()) |
|
|
|
_logDir.mkpath(_logDirPath); |
|
|
|
auto _logPath = _logDirPath + _currentDate + ".log"; |
|
|
|
|
|
|
|
QString _logPath; |
|
|
|
for(int i = 1; i < 1000; ++i) |
|
|
|
{ |
|
|
|
_logPath = _logDirPath + _currentDate + QString("_%1.log").arg(i); |
|
|
|
QFileInfo _fileInfo(_logPath); |
|
|
|
if(!_fileInfo.exists()) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
g_file.setFileName(_logPath); |
|
|
|
if(!g_file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) |
|
|
|
{ |
|
|
|