Skip to content

Commit

Permalink
better message logging for WMS retry
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Aug 22, 2013
1 parent a563f2a commit 3e27811
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,11 @@ void QgsWmsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in

void QgsWmsProvider::repeatTileRequest( QNetworkRequest const &oldRequest )
{
if ( mErrors == 100 )
{
QgsMessageLog::logMessage( tr( "Not logging more than 100 request errors." ), tr( "WMS" ) );
}

QNetworkRequest request( oldRequest );

QString url = request.url().toString();
Expand All @@ -1058,14 +1063,15 @@ void QgsWmsProvider::repeatTileRequest( QNetworkRequest const &oldRequest )
QgsMessageLog::logMessage( tr( "Tile request max retry error. Failed %1 requests for tile %2 of tileRequest %3 (url: %4)" )
.arg( maxRetry ).arg( tileNo ).arg( tileReqNo ).arg( url ), tr( "WMS" ) );
}
else if ( mErrors == 100 )
{
QgsMessageLog::logMessage( tr( "Not logging more than 100 request errors." ), tr( "WMS" ) );
}
return;
}

setAuthorization( request );
if ( mErrors < 100 )
{
QgsMessageLog::logMessage( tr( "repeat tileRequest %1 tile %2(retry %3)" )
.arg( tileReqNo ).arg( tileNo ).arg( retry ), tr( "WMS" ), QgsMessageLog::INFO );
}
QgsDebugMsg( QString( "repeat tileRequest %1 %2(retry %3) for url: %4" ).arg( tileReqNo ).arg( tileNo ).arg( retry ).arg( url ) );
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );

Expand Down

0 comments on commit 3e27811

Please sign in to comment.