diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2016-12-29 23:00:46 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2016-12-29 23:00:46 +0100 |
| commit | 538a0b2a6d3811dc7c9c17b8ecb00c14aea3294b (patch) | |
| tree | b1c902faf70b89647af41c0a099a0c3f56d7caf7 | |
| parent | 43a72d9b7fe4f5198f36413f2f009d1c9aa0618d (diff) | |
| download | manager-538a0b2a6d3811dc7c9c17b8ecb00c14aea3294b.tar.gz manager-538a0b2a6d3811dc7c9c17b8ecb00c14aea3294b.zip | |
Include pc-name into log
| -rw-r--r-- | src/CRSMLogging.cpp | 8 | ||||
| -rw-r--r-- | src/ClientInfo.hpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/CRSMLogging.cpp b/src/CRSMLogging.cpp index c019814..733f49c 100644 --- a/src/CRSMLogging.cpp +++ b/src/CRSMLogging.cpp @@ -110,11 +110,11 @@ void CRSMLogging::modLog(const QString &message, const ClientInfo &client, const { if(response) { - log("Response: " + client.toString(true) + " " + message.trimmed() + "\n", modLogsFolder + modName); + log("Response: " + client.toString(true, true) + " " + message.trimmed() + "\n", modLogsFolder + modName); } else { - log("Command: " + client.toString(true) + " " + message.trimmed() + "\n", modLogsFolder + modName); + log("Command: " + client.toString(true, true) + " " + message.trimmed() + "\n", modLogsFolder + modName); } } @@ -123,12 +123,12 @@ void CRSMLogging::commandLog(const QString &message, const ClientInfo &client, b if(response) { log("Response: " + message.trimmed() + "\n", cmdLogsFolder + client.toString()); - log("Response: " + client.toString(true) + " " + message.trimmed() + "\n", cmdsLogFile); + log("Response: " + client.toString(true, true) + " " + message.trimmed() + "\n", cmdsLogFile); } else { log("Command: " + message + "\n", cmdLogsFolder + client.toString()); - log("Command: " + client.toString(true) + " " + message + "\n", cmdsLogFile); + log("Command: " + client.toString(true, true) + " " + message + "\n", cmdsLogFile); } if(client.interface == Clonk) { diff --git a/src/ClientInfo.hpp b/src/ClientInfo.hpp index 57d2587..711bc71 100644 --- a/src/ClientInfo.hpp +++ b/src/ClientInfo.hpp @@ -107,11 +107,11 @@ public: return toString() < other.toString(); } - inline QString toString(bool asChatNick = false) const + inline QString toString(bool asChatNick = false, bool withPCName = false) const { if(asChatNick) { - return interface == Auto ? "<~auto~>" : interface == Management ? "{CLI}<" + management.name + ">" : interface == IRC ? "[IRC]<" + nick + ">" : "<" + nick + ">"; + return interface == Auto ? "<~auto~>" : interface == Management ? "{CLI}<" + management.name + ">" : interface == IRC ? "[IRC]<" + nick + ">" : "<" + nick + (withPCName ? "|" + pcName : "") + ">"; } else { |
