AppOutputPane: Switch to categorized logging

Change-Id: I349aee7cf507ec7e79e73b7e091f75d4607e790b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2019-03-16 17:07:20 +01:00
committed by André Hartmann
parent 4f3f73bc3b
commit 1e3653992e

View File

@@ -53,6 +53,7 @@
#include <QCheckBox> #include <QCheckBox>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QLabel> #include <QLabel>
#include <QLoggingCategory>
#include <QMenu> #include <QMenu>
#include <QSpinBox> #include <QSpinBox>
#include <QTabBar> #include <QTabBar>
@@ -60,9 +61,7 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QDebug> static Q_LOGGING_CATEGORY(appOutputLog, "qtc.projectexplorer.appoutput", QtWarningMsg);
enum { debug = 0 };
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal; using namespace ProjectExplorer::Internal;
@@ -263,8 +262,7 @@ AppOutputPane::AppOutputPane() :
AppOutputPane::~AppOutputPane() AppOutputPane::~AppOutputPane()
{ {
if (debug) qCDebug(appOutputLog) << "AppOutputPane::~AppOutputPane: Entries left" << m_runControlTabs.size();
qDebug() << "OutputPane::~OutputPane: Entries left" << m_runControlTabs.size();
for (const RunControlTab &rt : qAsConst(m_runControlTabs)) { for (const RunControlTab &rt : qAsConst(m_runControlTabs)) {
delete rt.window; delete rt.window;
@@ -444,8 +442,8 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
m_tabWidget->setTabText(tabIndex, rc->displayName()); m_tabWidget->setTabText(tabIndex, rc->displayName());
tab.window->scrollToBottom(); tab.window->scrollToBottom();
if (debug) qCDebug(appOutputLog) << "AppOutputPane::createNewOutputWindow: Reusing tab"
qDebug() << "OutputPane::createNewOutputWindow: Reusing tab" << tabIndex << " for " << rc; << tabIndex << "for" << rc;
return; return;
} }
// Create new // Create new
@@ -472,8 +470,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
agg->add(new Core::BaseTextFind(ow)); agg->add(new Core::BaseTextFind(ow));
m_runControlTabs.push_back(RunControlTab(rc, ow)); m_runControlTabs.push_back(RunControlTab(rc, ow));
m_tabWidget->addTab(ow, rc->displayName()); m_tabWidget->addTab(ow, rc->displayName());
if (debug) qCDebug(appOutputLog) << "AppOutputPane::createNewOutputWindow: Adding tab for" << rc;
qDebug() << "OutputPane::createNewOutputWindow: Adding tab for " << rc;
updateCloseActions(); updateCloseActions();
} }
@@ -592,8 +589,7 @@ void AppOutputPane::stopRunControl()
rc->forceStop(); rc->forceStop();
} }
if (debug) qCDebug(appOutputLog) << "AppOutputPane::stopRunControl" << rc;
qDebug() << "OutputPane::stopRunControl " << rc;
} }
void AppOutputPane::closeTabs(CloseTabMode mode) void AppOutputPane::closeTabs(CloseTabMode mode)
@@ -617,8 +613,7 @@ void AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode)
RunControl *runControl = m_runControlTabs[index].runControl; RunControl *runControl = m_runControlTabs[index].runControl;
Core::OutputWindow *window = m_runControlTabs[index].window; Core::OutputWindow *window = m_runControlTabs[index].window;
if (debug) qCDebug(appOutputLog) << "AppOutputPane::closeTab tab" << tabIndex << runControl << window;
qDebug() << "OutputPane::closeTab tab " << tabIndex << runControl << window;
// Prompt user to stop // Prompt user to stop
if (closeTabMode == CloseTabWithPrompt) { if (closeTabMode == CloseTabWithPrompt) {
QWidget *tabWidget = m_tabWidget->widget(tabIndex); QWidget *tabWidget = m_tabWidget->widget(tabIndex);
@@ -769,9 +764,8 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender)
// Enable buttons for current // Enable buttons for current
RunControl *current = currentRunControl(); RunControl *current = currentRunControl();
if (debug) qCDebug(appOutputLog) << "AppOutputPane::runControlFinished" << sender << senderIndex
qDebug() << "OutputPane::runControlFinished" << sender << senderIndex << "current" << current << m_runControlTabs.size();
<< " current " << current << m_runControlTabs.size();
if (current && current == sender) if (current && current == sender)
enableButtons(current); enableButtons(current);