aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2021-04-20 08:13:56 +0300
committerGitHub <noreply@github.com>2021-04-20 00:13:56 -0500
commit81c0f9a569eaee58a28ca521b15ab397c03a4890 (patch)
treeb1236ed2b9e7be88ced861c20ab4060256e76542 /src
parent31073d090fc1bbc48e3cd3ea1ec5763c34cf6b2d (diff)
Better logs with OOC logging, [IC] and [OOC] tags (#519)
* Add OOC logging to the .log files, making them infinitely more precious to GMs especially of ambitious multi-area RPs Add [IC] and [OOC] tags to distinguish between the types of msg * minor wording change for .log top line to make it clearer that it's the server address and not the user address Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/courtroom.cpp5
-rw-r--r--src/packet_distribution.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index fd0e1ca1..9a6fd08d 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1647,6 +1647,11 @@ void Courtroom::append_server_chatmessage(QString p_name, QString p_message,
ui_server_chatlog->append_chatmessage(p_name, p_message, color);
+
+ if (ao_app->get_auto_logging_enabled() && !ao_app->log_filename.isEmpty()) {
+ QString full = "[OOC][" + QDateTime::currentDateTime().toUTC().toString() + "] " + p_name + ": " + p_message;
+ ao_app->append_to_file(full, ao_app->log_filename, true);
+ }
}
void Courtroom::on_authentication_state_received(int p_state)
diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp
index cf510026..dc76ec1a 100644
--- a/src/packet_distribution.cpp
+++ b/src/packet_distribution.cpp
@@ -308,7 +308,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
this->log_filename = QDateTime::currentDateTime().toUTC().toString(
"'logs/" + server_name.remove(QRegExp("[\\\\/:*?\"<>|\']")) +
"/'yyyy-MM-dd hh-mm-ss t'.log'");
- this->write_to_file("Joined server " + server_name + " on address " +
+ this->write_to_file("Joined server " + server_name + " hosted on address " +
server_address + " on " +
QDateTime::currentDateTime().toUTC().toString(),
log_filename, true);