From 279fe86dfaf01580ddd0a4c48b8b3691ea67d63c Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Wed, 31 Mar 2021 23:19:13 -0500 Subject: [PATCH 1/3] logger txt output workaround --- src/logger.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/logger.cpp b/src/logger.cpp index 9e33240..0d3dc3c 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -85,6 +85,7 @@ void Logger::addEntry(QString entry) { if (buffer.length() < max_length) { buffer.enqueue(entry); + flush(); } else { buffer.dequeue(); From 726fd39065726c1c0a9a25df6ab322fa833adf96 Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Wed, 31 Mar 2021 23:20:47 -0500 Subject: [PATCH 2/3] logger txt output workaround --- src/packets.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packets.cpp b/src/packets.cpp index 80e89ce..3334fef 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -286,7 +286,6 @@ void AOClient::pktModCall(AreaData* area, int argc, QStringList argv, AOPacket p client->sendPacket(packet); } area->logger->logModcall(this, &packet); - area->logger->flush(); } void AOClient::pktAddEvidence(AreaData* area, int argc, QStringList argv, AOPacket packet) From 996fed1afb265ffb95bb959d094eb2c22cb0a561 Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Fri, 2 Apr 2021 18:43:09 -0500 Subject: [PATCH 3/3] Change log file directory --- src/logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logger.cpp b/src/logger.cpp index 688d6bb..f43e0f4 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -92,7 +92,7 @@ void Logger::flush() // 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())