diff --git a/src/plugins/clangcodemodel/clangbackendipcintegration.cpp b/src/plugins/clangcodemodel/clangbackendipcintegration.cpp index fba1885236e..6b68a98ddae 100644 --- a/src/plugins/clangcodemodel/clangbackendipcintegration.cpp +++ b/src/plugins/clangcodemodel/clangbackendipcintegration.cpp @@ -92,9 +92,27 @@ QString backendProcessPath() + QStringLiteral(QTC_HOST_EXE_SUFFIX); } +bool printAliveMessageHelper() +{ + const bool print = qEnvironmentVariableIntValue("QTC_CLANG_FORCE_VERBOSE_ALIVE"); + if (!print) { + qCDebug(log) << "Hint: AliveMessage will not be printed. " + "Force it by setting QTC_CLANG_FORCE_VERBOSE_ALIVE=1."; + } + + return print; +} + +bool printAliveMessage() +{ + static bool print = log().isDebugEnabled() ? printAliveMessageHelper() : false; + return print; +} + } // anonymous namespace IpcReceiver::IpcReceiver() + : m_printAliveMessage(printAliveMessage()) { } @@ -143,7 +161,8 @@ bool IpcReceiver::isExpectingCodeCompletedMessage() const void IpcReceiver::alive() { - qCDebug(log) << "<<< AliveMessage"; + if (m_printAliveMessage) + qCDebug(log) << "<<< AliveMessage"; QTC_ASSERT(m_aliveHandler, return); m_aliveHandler(); } diff --git a/src/plugins/clangcodemodel/clangbackendipcintegration.h b/src/plugins/clangcodemodel/clangbackendipcintegration.h index 60b915bfc25..a85ec6d5a17 100644 --- a/src/plugins/clangcodemodel/clangbackendipcintegration.h +++ b/src/plugins/clangcodemodel/clangbackendipcintegration.h @@ -85,6 +85,7 @@ private: private: AliveHandler m_aliveHandler; QHash m_assistProcessorsTable; + const bool m_printAliveMessage = false; }; class IpcSenderInterface