Skip to content
Permalink
Browse files

Nicer level string in message log window

  • Loading branch information
NathanW2 committed Jul 24, 2017
1 parent d055def commit 601dd412133ca99155fad5db14221c4887f2b3c7
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/gui/qgsmessagelogviewer.cpp
@@ -75,9 +75,26 @@ void QgsMessageLogViewer::logMessage( const QString &message, const QString &tag
tabWidget->setTabsClosable( true );
}

QString levelString;
switch ( level )
{
case QgsMessageLog::INFO:
levelString = "INFO";
break;
case QgsMessageLog::WARNING:
levelString = "WARNING";
break;
case QgsMessageLog::CRITICAL:
levelString = "CRITICAL";
break;
case QgsMessageLog::NONE:
levelString = "NONE";
break;
}

QString prefix = QStringLiteral( "%1\t%2\t" )
.arg( QDateTime::currentDateTime().toString( Qt::ISODate ) )
.arg( level );
.arg( levelString );
QString cleanedMessage = message;
cleanedMessage = cleanedMessage.prepend( prefix ).replace( '\n', QLatin1String( "\n\t\t\t" ) );
w->appendPlainText( cleanedMessage );

0 comments on commit 601dd41

Please sign in to comment.
You can’t perform that action at this time.