mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
02b6fcb089
commit
29ab61efdf
|
@ -168,6 +168,10 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
qDebug() << "Log file over 1MB, rotating...";
|
||||
|
||||
// close old logfile (need for windows)
|
||||
if(mainLogFilePtr)
|
||||
fclose(mainLogFilePtr);
|
||||
|
||||
QDir dir (logFileDir);
|
||||
|
||||
// Check if log.1 already exists, and if so, delete it
|
||||
|
@ -179,10 +183,6 @@ int main(int argc, char *argv[])
|
|||
if(!dir.rename(logFileDir + "qtox.log", logFileDir + "qtox.log.1"))
|
||||
qCritical() << "Unable to move logs";
|
||||
|
||||
// close old logfile
|
||||
if(mainLogFilePtr)
|
||||
fclose(mainLogFilePtr);
|
||||
|
||||
// open a new logfile
|
||||
mainLogFilePtr = fopen(logfile.toLocal8Bit().constData(), "a");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user