aboutsummaryrefslogtreecommitdiff
path: root/src/packet_distribution.cpp
diff options
context:
space:
mode:
authorwindrammer <31085911+likeawindrammer@users.noreply.github.com>2020-07-31 14:14:39 -0600
committerGitHub <noreply@github.com>2020-07-31 15:14:39 -0500
commit36b5af3cb9ce8e5530c5bd9353a4e2f10da506b6 (patch)
tree19e9217126837cac1ae3ab025b050bb3cfbda64b /src/packet_distribution.cpp
parentbab10ea14ddaf7af7aeeff925b373be1c347d0d7 (diff)
Add option for automatic logging (#203)
Just so we're on the same page, this is enabled by default. Co-authored-by: Cents02 <Cents02@Cents0.me>
Diffstat (limited to 'src/packet_distribution.cpp')
-rw-r--r--src/packet_distribution.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp
index 669b9541..b543cfb5 100644
--- a/src/packet_distribution.cpp
+++ b/src/packet_distribution.cpp
@@ -292,13 +292,16 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
// Remove any characters not accepted in folder names for the server_name
// here
- this->log_filename = QDateTime::currentDateTime().toUTC().toString(
- "'logs/" + server_name.remove(QRegExp("[\\\\/:*?\"<>|\']")) +
- "/'ddd MMMM yyyy hh.mm.ss t'.log'");
- this->write_to_file("Joined server " + server_name + " on address " +
- server_address + " on " +
- QDateTime::currentDateTime().toUTC().toString(),
- log_filename, true);
+ if (AOApplication::get_auto_logging_enabled()){
+ this->log_filename = QDateTime::currentDateTime().toUTC().toString(
+ "'logs/" + server_name.remove(QRegExp("[\\\\/:*?\"<>|\']")) +
+ "/'ddd MMMM yyyy hh.mm.ss t'.log'");
+ this->write_to_file("Joined server " + server_name + " on address " +
+ server_address + " on " +
+ QDateTime::currentDateTime().toUTC().toString(),
+ log_filename, true);
+ }
+
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
hash.addData(server_address.toUtf8());
if (is_discord_enabled())