From 6511e13585d99d3c61805fcfc4b7bf467573a8a2 Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Sat, 3 Apr 2021 20:35:21 -0500 Subject: [PATCH] Save server logs to logs/ instead of config/ --- src/logger.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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())