~renatofilho/sync-monitor/remove-addressbook

« back to all changes in this revision

Viewing changes to src/sync-daemon.cpp

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2014-04-03 21:45:01 UTC
  • Revision ID: renato.filho@canonical.com-20140403214501-w0dn5zlmsrintpnz
Improved debug messages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
        return "Disk is full";
184
184
    default:
185
185
        qWarning() << "invalid last status:" << status;
186
 
        return "";
 
186
        return "Unknow error: " + status;
187
187
    }
188
188
}
189
189
 
279
279
                                        QString("Start sync:  %1 (%2)")
280
280
                                        .arg(m_currentAccount->displayName())
281
281
                                        .arg(serviceName));
282
 
    } else {
283
 
        qDebug() << "Syncronization"
284
 
                 << QString("Start sync:  %1 (%2)")
285
 
                    .arg(m_currentAccount->displayName())
286
 
                    .arg(serviceName);
287
282
    }
 
283
    m_syncElapsedTime.restart();
 
284
    qDebug() << QString("[%3] Start sync:  %1 (%2)")
 
285
                .arg(m_currentAccount->displayName())
 
286
                .arg(serviceName)
 
287
                .arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate));
288
288
    Q_EMIT syncStarted(m_currentAccount, serviceName);
289
289
}
290
290
 
302
302
                                        .arg(m_currentAccount->displayName())
303
303
                                        .arg(serviceName)
304
304
                                        .arg(errorMessage));
305
 
    } else {
306
 
        qDebug() << "Syncronization"
307
 
                 << QString("Sync done: %1 (%2) Status: %3 ")
308
 
                    .arg(m_currentAccount->displayName())
309
 
                    .arg(serviceName)
310
 
                    .arg(status);
311
305
    }
312
306
 
313
 
 
 
307
    qDebug() << QString("[%6] Sync done: %1 (%2) Status: %3 Error: %4 Duration: %5s")
 
308
                .arg(m_currentAccount->displayName())
 
309
                .arg(serviceName)
 
310
                .arg(status)
 
311
                .arg(errorMessage.isEmpty() ? "None" : errorMessage)
 
312
                .arg((m_syncElapsedTime.elapsed() > 60 ? 1  : m_syncElapsedTime.elapsed() / 60))
 
313
                .arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate));
314
314
 
315
315
    Q_EMIT syncFinished(m_currentAccount, serviceName);
316
316
    // sync next account