Skip to content

Commit

Permalink
indent multiline messages in log
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 14, 2014
1 parent 93e2159 commit 342ad2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/qgsmessagelogviewer.cpp
Expand Up @@ -145,9 +145,10 @@ void QgsMessageLogViewer::logMessage( QString message, QString tag, QgsMessageLo
tabWidget->setCurrentIndex( tabWidget->count() - 1 );
}

QString date = QDateTime::currentDateTime().toString( Qt::ISODate );
message = message.replace( "\n", "<br>" );
w->appendHtml( QString("<i>%1</i> | <i>%2</i> | %3").arg( date ).arg( QString::number( level ) ).arg( message ) );
QString prefix = QString( "%1\t%2\t")
.arg( QDateTime::currentDateTime().toString( Qt::ISODate ) )
.arg( level );
w->appendPlainText( message.prepend( prefix ).replace( "\n", "\n\t\t\t" ) );
w->verticalScrollBar()->setValue( w->verticalScrollBar()->maximum() );
}

Expand Down

0 comments on commit 342ad2b

Please sign in to comment.