Cloud storage: in verbose mode give lots of progress information

If a user gets stuck accessing cloud storage it's often hard to figure out
which step is hanging which makes it much harder to narrow down the
problem. With this patch calling Subsurface with '-v' will give somewhat
finely grained progress information on stderr.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-09-20 10:11:09 -07:00
parent 54ec332c2f
commit d0fba482b7
4 changed files with 42 additions and 1 deletions

View file

@ -40,6 +40,8 @@ bool CheckCloudConnection::checkServer()
reply->readAll() == QByteArray(MILK)) {
reply->deleteLater();
mgr->deleteLater();
if (verbose > 1)
qWarning() << "Cloud storage: successfully checked connection to cloud server";
return true;
}
// qDebug() << "did not get expected response - server unreachable" <<
@ -52,11 +54,15 @@ bool CheckCloudConnection::checkServer()
}
reply->deleteLater();
mgr->deleteLater();
if (verbose)
qWarning() << "Cloud storage: unable to connect to cloud server";
return false;
}
// helper to be used from C code
extern "C" bool canReachCloudServer()
{
if (verbose)
qWarning() << "Cloud storage: checking connection to cloud server";
return CheckCloudConnection::checkServer();
}