diff --git a/src/logger.cpp b/src/logger.cpp index 0b5f333..0849f18 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -88,10 +88,14 @@ void Logger::addEntry(QString entry) void Logger::flush() { + QDir dir("logs/"); + if (!dir.exists()) { + dir.mkpath("."); + } // raiden suggested this, but idk if i want to use it // QString time = QDateTime::currentDateTime().toString("ddd mm/dd/yy hh:mm:ss"); // QString filename = QStringLiteral("reports/%1/%2.log").arg(area->name).arg(time); - QFile logfile("config/server.log"); + QFile logfile("logs/server.log"); if (logfile.open(QIODevice::WriteOnly | QIODevice::Append)) { QTextStream file_stream(&logfile); while (!buffer.isEmpty())