forked from qt-creator/qt-creator
OutputFormatter: Reduce usages of DebugFormat
This is usually used in a wrong or at least misleading way. Replace most of the usages by newly introduced GeneralMessageFormat as most of the replaced usages just print to General Messages and using any of the existing formats would change the layout of the text. Except for some special debug output inside the valgrind plugin that can use one of the existing formats which also makes it easier to spot them and the runners which print QC internal output. Task-number: QTCREATORBUG-24560 Change-Id: I824dc4250b2f3e4656bab8676b45c98e3407d59c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -35,6 +35,7 @@ enum OutputFormat
|
||||
DebugFormat,
|
||||
StdOutFormat,
|
||||
StdErrFormat,
|
||||
GeneralMessageFormat,
|
||||
NumberOfFormats // Keep this entry last.
|
||||
};
|
||||
|
||||
|
@@ -496,6 +496,7 @@ void OutputFormatter::initFormats()
|
||||
d->formats[StdOutFormat].setForeground(theme->color(Theme::OutputPanes_StdOutTextColor));
|
||||
d->formats[StdErrFormat].setForeground(theme->color(Theme::OutputPanes_StdErrTextColor));
|
||||
d->formats[DebugFormat].setForeground(theme->color(Theme::OutputPanes_DebugTextColor));
|
||||
d->formats[GeneralMessageFormat].setForeground(theme->color(Theme::OutputPanes_DebugTextColor));
|
||||
setBoldFontEnabled(d->boldFontEnabled);
|
||||
}
|
||||
|
||||
|
@@ -128,7 +128,7 @@ void AndroidRunner::stop()
|
||||
if (m_checkAVDTimer.isActive()) {
|
||||
m_checkAVDTimer.stop();
|
||||
appendMessage("\n\n" + tr("\"%1\" terminated.").arg(m_packageName),
|
||||
Utils::DebugFormat);
|
||||
Utils::NormalMessageFormat);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ void AndroidRunner::handleRemoteProcessStarted(Utils::Port debugServerPort,
|
||||
|
||||
void AndroidRunner::handleRemoteProcessFinished(const QString &errString)
|
||||
{
|
||||
appendMessage(errString, Utils::DebugFormat);
|
||||
appendMessage(errString, Utils::NormalMessageFormat);
|
||||
if (runControl()->isRunning())
|
||||
runControl()->initiateStop();
|
||||
reportStopped();
|
||||
|
@@ -107,7 +107,7 @@ QString MessageOutputWindow::displayName() const
|
||||
|
||||
void MessageOutputWindow::append(const QString &text)
|
||||
{
|
||||
m_widget->appendMessage(text, Utils::DebugFormat);
|
||||
m_widget->appendMessage(text, Utils::GeneralMessageFormat);
|
||||
}
|
||||
|
||||
int MessageOutputWindow::priorityInStatusBar() const
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
if (url.isValid()) {
|
||||
args.append(QStringList{"--host", url.host(), "--port", QString::number(url.port())});
|
||||
}
|
||||
appendMessage("PerfParser args: " + args.join(' '), Utils::DebugFormat);
|
||||
appendMessage("PerfParser args: " + args.join(' '), Utils::NormalMessageFormat);
|
||||
m_reader.createParser(args);
|
||||
m_reader.startParser();
|
||||
}
|
||||
|
@@ -424,7 +424,7 @@ void QmlDebugTranslationWidget::loadLogFile()
|
||||
if (f.open(QFile::ReadOnly)) {
|
||||
clear();
|
||||
while (!f.atEnd())
|
||||
appendMessage(QString::fromUtf8(f.readLine()), Utils::DebugFormat);
|
||||
appendMessage(QString::fromUtf8(f.readLine()), Utils::GeneralMessageFormat);
|
||||
} else {
|
||||
// TODO: maybe add this message to log and tasks
|
||||
qWarning() << "Failed to open" << fileName << ":" << f.errorString();
|
||||
|
@@ -72,9 +72,9 @@ void ValgrindToolRunner::start()
|
||||
m_progress.reportStarted();
|
||||
|
||||
#if VALGRIND_DEBUG_OUTPUT
|
||||
emit outputReceived(tr("Valgrind options: %1").arg(toolArguments().join(' ')), DebugFormat);
|
||||
emit outputReceived(tr("Working directory: %1").arg(runnable().workingDirectory), DebugFormat);
|
||||
emit outputReceived(tr("Command line arguments: %1").arg(runnable().debuggeeArgs), DebugFormat);
|
||||
emit outputReceived(tr("Valgrind options: %1").arg(toolArguments().join(' ')), LogMessageFormat);
|
||||
emit outputReceived(tr("Working directory: %1").arg(runnable().workingDirectory), LogMessageFormat);
|
||||
emit outputReceived(tr("Command line arguments: %1").arg(runnable().debuggeeArgs), LogMessageFormat);
|
||||
#endif
|
||||
|
||||
CommandLine valgrind{m_settings.valgrindExecutable()};
|
||||
|
Reference in New Issue
Block a user