Skip to content

Commit

Permalink
Merge pull request #1537 from Karry/tile-downloader-log
Browse files Browse the repository at this point in the history
polish tile downloader log
  • Loading branch information
Framstag authored Dec 16, 2023
2 parents fbf80fd + fb7fcf7 commit faa9e63
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void OsmTileDownloader::download(uint32_t zoomLevel, uint32_t x, uint32_t y)
QString server = QString::fromStdString(servers[serverNumber % servers.size()]);

QUrl tileUrl(server.arg(zoomLevel).arg(x).arg(y));
osmscout::log.Debug() << "Download tile" << tileUrl.toString().toStdString() << "(current thread:" << QThread::currentThread() << ")";
osmscout::log.Debug() << "Download tile " << tileUrl.toString().toStdString();

TileCacheKey key = {zoomLevel, x, y};

Expand All @@ -102,7 +102,7 @@ void OsmTileDownloader::fileDownloaded(const TileCacheKey &key, QNetworkReply *r
QUrl url = reply->url();

if (reply->error() != QNetworkReply::NoError){
osmscout::log.Warn() << "Downloading" << url.toString().toStdString() << "failed with" << reply->errorString().toStdString();
osmscout::log.Warn() << "Downloading " << url.toString().toStdString() << " failed with " << reply->errorString().toStdString();
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) /* For compatibility with QT 5.6 */
serverNumber = qrand(); // try another server for future requests
#else
Expand All @@ -114,7 +114,7 @@ void OsmTileDownloader::fileDownloaded(const TileCacheKey &key, QNetworkReply *r

QImage image;
if (image.loadFromData(downloadedData, Q_NULLPTR)){
osmscout::log.Debug() << "Downloaded tile " << url.toString().toStdString() << " (current thread: " << QThread::currentThread() << ")";
osmscout::log.Debug() << "Downloaded tile " << url.toString().toStdString();

emit downloaded(key.zoomLevel, key.xtile, key.ytile, image, downloadedData);
}else{
Expand Down

0 comments on commit faa9e63

Please sign in to comment.