Make logging more useful

- Do not log progress percent but log job names.
- Log install failures.
This commit is contained in:
Aurélien Gâteau 2014-08-01 17:00:21 +02:00
parent d175d199eb
commit 70a13fc588
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,7 @@ public:
for( auto job : m_jobs )
{
emitProgress();
cLog() << "Starting job" << job->prettyName();
connect( job.data(), &Job::progress, this, &JobThread::emitProgress );
JobResult result = job->exec();
if ( !result )
@ -86,7 +87,6 @@ private:
: tr( "Done" );
qreal percent = ( m_jobIndex + jobPercent ) / qreal( jobCount );
cLog() << Q_FUNC_INFO << "percent=" << percent * 100 << message;
QMetaObject::invokeMethod( m_queue, "progress", Qt::QueuedConnection,
Q_ARG( qreal, percent ),

View File

@ -18,6 +18,7 @@
#include "ViewManager.h"
#include "utils/Logger.h"
#include "viewpages/ViewStep.h"
#include "InstallationViewStep.h"
#include "JobQueue.h"
@ -119,6 +120,10 @@ ViewManager::insertViewStep( int before, ViewStep* step)
void
ViewManager::onInstallationFailed( const QString& message, const QString& details )
{
cLog() << "Installation failed:";
cLog() << "- message:" << message;
cLog() << "- details:" << details;
QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Critical );
msgBox.setWindowTitle( tr("Error") );