mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 10:40:59 +00:00
Clean up old log files if more than 10 exist
This commit is contained in:
@@ -326,6 +326,15 @@ int main(int argc, char *argv[])
|
||||
SetUnhandledExceptionFilter(UnhandledExceptionHandler);
|
||||
#endif
|
||||
|
||||
#ifdef LOG_TO_FILE
|
||||
// Prune the oldest existing logs if there are more than 10
|
||||
QStringList existingLogNames = tempDir.entryList(QStringList("Moonlight-*.log"), QDir::NoFilter, QDir::SortFlag::Time);
|
||||
for (int i = 10; i < existingLogNames.size(); i++) {
|
||||
qInfo() << "Removing old log file:" << existingLogNames.at(i);
|
||||
QFile(tempDir.filePath(existingLogNames.at(i))).remove();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
// Force AntiHooking.dll to be statically imported and loaded
|
||||
// by ntdll on Win32 platforms by calling a dummy function.
|
||||
|
||||
Reference in New Issue
Block a user