forked from qt-creator/qt-creator
QbsProjectManager: Logging improvements.
- Make messages with level "warning" or "error" appear in the Issues pane. - Do not suppress messages of level "info". People add "console.info()" calls into their projects for debugging and they expect to see the output in Creator. Task-number: QTCREATORBUG-15983 Change-Id: I6c84bc1ef08dbf85d7e88af864b18f64fcedfe1a Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
@@ -79,6 +79,10 @@ void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message,
|
|||||||
|
|
||||||
{
|
{
|
||||||
QMutexLocker l(&m_mutex);
|
QMutexLocker l(&m_mutex);
|
||||||
|
if (level <= qbs::LoggerWarning) {
|
||||||
|
doPrintWarning(qbs::ErrorInfo(message));
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_messages.append(qbs::logLevelTag(level) + message);
|
m_messages.append(qbs::logLevelTag(level) + message);
|
||||||
}
|
}
|
||||||
QMetaObject::invokeMethod(this, "sendMessages", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, "sendMessages", Qt::QueuedConnection);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ QbsManager::QbsManager() :
|
|||||||
this, &QbsManager::updateAllProfiles);
|
this, &QbsManager::updateAllProfiles);
|
||||||
|
|
||||||
m_logSink = new QbsLogSink(this);
|
m_logSink = new QbsLogSink(this);
|
||||||
int level = qbs::LoggerWarning;
|
int level = qbs::LoggerInfo;
|
||||||
const QString levelEnv = QString::fromLocal8Bit(qgetenv("QBS_LOG_LEVEL"));
|
const QString levelEnv = QString::fromLocal8Bit(qgetenv("QBS_LOG_LEVEL"));
|
||||||
if (!levelEnv.isEmpty()) {
|
if (!levelEnv.isEmpty()) {
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user