From 538a0b2a6d3811dc7c9c17b8ecb00c14aea3294b Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Thu, 29 Dec 2016 23:00:46 +0100 Subject: Include pc-name into log --- src/CRSMLogging.cpp | 8 ++++---- 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 { -- cgit v1.2.3-54-g00ecf