From dbe40332cd904f8e48504a2e8a3e7f74f4619712 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 30 Jun 2013 13:37:31 +0300 Subject: Add support for logging debug chat tab. Disabled by default. --- src/gui/setup_chat.cpp | 4 ++++ src/gui/widgets/chattab.cpp | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/setup_chat.cpp b/src/gui/setup_chat.cpp index a953ab4df..80e166639 100644 --- a/src/gui/setup_chat.cpp +++ b/src/gui/setup_chat.cpp @@ -105,6 +105,10 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemCheckBox(_("Enable chat Log"), "", "enableChatLog", this, "enableChatLogEvent"); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Enable debug chat Log"), "", + "enableDebugLog", this, "enableDebugLogEvent"); + // TRANSLATORS: settings option new SetupItemCheckBox(_("Show chat history"), "", "showChatHistory", this, "showChatHistoryEvent"); diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 3ab9594fe..41b57c035 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -445,8 +445,18 @@ bool ChatTab::handleCommands(const std::string &type, const std::string &args) void ChatTab::saveToLogFile(const std::string &msg) { - if (getType() == TAB_INPUT && chatLogger) - chatLogger->log(msg); + if (chatLogger) + { + if (getType() == TAB_INPUT) + { + chatLogger->log(msg); + } + else if (getType() == TAB_DEBUG + && config.getBoolValue("enableDebugLog")) + { + chatLogger->log("#Debug", msg); + } + } } int ChatTab::getType() const -- cgit v1.2.3-60-g2f50