Skip to content

Commit

Permalink
Quiet noisy wfs provider debug messages
Browse files Browse the repository at this point in the history
(cherry-picked from 91572be)
  • Loading branch information
nyalldawson committed Aug 17, 2018
1 parent e89412b commit ee7cfcc
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 93 deletions.
18 changes: 9 additions & 9 deletions src/providers/wfs/qgswfscapabilities.cpp
Expand Up @@ -120,7 +120,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
{
const QByteArray &buffer = mResponse;

QgsDebugMsg( "parsing capabilities: " + buffer );
QgsDebugMsgLevel( QStringLiteral( "parsing capabilities: " ) + buffer, 4 );

// parse XML
QString capabilitiesDocError;
Expand Down Expand Up @@ -214,7 +214,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( !value.isNull() )
{
mCaps.maxFeatures = value.text().toInt();
QgsDebugMsg( QString( "maxFeatures: %1" ).arg( mCaps.maxFeatures ) );
QgsDebugMsg( QStringLiteral( "maxFeatures: %1" ).arg( mCaps.maxFeatures ) );
}
}
else if ( contraint.attribute( QStringLiteral( "name" ) ) == QLatin1String( "CountDefault" ) /* WFS 2.0 (e.g. MapServer) */ )
Expand All @@ -223,7 +223,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( !value.isNull() )
{
mCaps.maxFeatures = value.text().toInt();
QgsDebugMsg( QString( "maxFeatures: %1" ).arg( mCaps.maxFeatures ) );
QgsDebugMsg( QStringLiteral( "maxFeatures: %1" ).arg( mCaps.maxFeatures ) );
}
}
else if ( contraint.attribute( QStringLiteral( "name" ) ) == QLatin1String( "ImplementsResultPaging" ) /* WFS 2.0 */ )
Expand All @@ -232,7 +232,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( !value.isNull() && value.text() == QLatin1String( "TRUE" ) )
{
mCaps.supportsPaging = true;
QgsDebugMsg( "Supports paging" );
QgsDebugMsg( QStringLiteral( "Supports paging" ) );
}
}
else if ( contraint.attribute( QStringLiteral( "name" ) ) == QLatin1String( "ImplementsStandardJoins" ) ||
Expand All @@ -242,7 +242,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( !value.isNull() && value.text() == QLatin1String( "TRUE" ) )
{
mCaps.supportsJoins = true;
QgsDebugMsg( "Supports joins" );
QgsDebugMsg( QStringLiteral( "Supports joins" ) );
}
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( !value.isNull() )
{
mCaps.maxFeatures = value.text().toInt();
QgsDebugMsg( QString( "maxFeatures: %1" ).arg( mCaps.maxFeatures ) );
QgsDebugMsg( QStringLiteral( "maxFeatures: %1" ).arg( mCaps.maxFeatures ) );
}
break;
}
Expand All @@ -305,7 +305,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( value.text() == QLatin1String( "hits" ) )
{
mCaps.supportsHits = true;
QgsDebugMsg( "Support hits" );
QgsDebugMsg( QStringLiteral( "Support hits" ) );
break;
}
}
Expand Down Expand Up @@ -395,7 +395,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
{
featureType.name = nameList.at( 0 ).toElement().text();

QgsDebugMsg( QString( "featureType.name = %1" ) . arg( featureType.name ) );
QgsDebugMsgLevel( QStringLiteral( "featureType.name = %1" ) . arg( featureType.name ), 4 );
if ( featureType.name.contains( ':' ) )
{
QString prefixOfTypename = featureType.name.section( ':', 0, 0 );
Expand Down Expand Up @@ -502,7 +502,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
std::fabs( featureType.bbox.xMaximum() - ptMaxBack.x() ) < 1e-5 &&
std::fabs( featureType.bbox.yMaximum() - ptMaxBack.y() ) < 1e-5 )
{
QgsDebugMsg( "Values of LatLongBoundingBox are consistent with WGS84 long/lat bounds, so as the CRS is projected, assume they are indeed in WGS84 and not in the CRS units" );
QgsDebugMsg( QStringLiteral( "Values of LatLongBoundingBox are consistent with WGS84 long/lat bounds, so as the CRS is projected, assume they are indeed in WGS84 and not in the CRS units" ) );
featureType.bboxSRSIsWGS84 = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsconnection.cpp
Expand Up @@ -39,7 +39,7 @@ QgsWfsConnection::QgsWfsConnection( const QString &connName )
mUri.setParam( QgsWFSConstants::URI_PARAM_MAXNUMFEATURES, maxnumfeatures );
}

QgsDebugMsg( QString( "WFS full uri: '%1'." ).arg( QString( mUri.uri() ) ) );
QgsDebugMsg( QStringLiteral( "WFS full uri: '%1'." ).arg( QString( mUri.uri() ) ) );
}

QStringList QgsWfsConnection::connectionList()
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wfs/qgswfsdataitems.cpp
Expand Up @@ -87,7 +87,7 @@ void QgsWfsLayerItem::copyStyle()
{
#ifdef QGISDEBUG
QString errorMsg( QStringLiteral( "Cannot get style for layer %1" ).arg( this->name() ) );
QgsDebugMsg( " Cannot get style: " + errorMsg );
QgsDebugMsg( QStringLiteral( " Cannot get style: " ) + errorMsg );
#endif
#if 0
// TODO: how to emit message from provider (which does not know about QgisApp)
Expand Down Expand Up @@ -306,7 +306,7 @@ QgsDataItem *QgsWfsDataItemProvider::createDataItem( const QString &path, QgsDat

QgsWFSDataSourceURI sourceUri( geonodeRequest.fetchServiceUrlsBlocking( QStringLiteral( "WFS" ) )[0] );

QgsDebugMsgLevel( QString( "WFS full uri: '%1'." ).arg( QString( sourceUri.uri() ) ), 4 );
QgsDebugMsgLevel( QStringLiteral( "WFS full uri: '%1'." ).arg( QString( sourceUri.uri() ) ), 4 );

return new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, sourceUri.uri( false ) );
}
Expand Down
26 changes: 13 additions & 13 deletions src/providers/wfs/qgswfsfeatureiterator.cpp
Expand Up @@ -103,14 +103,14 @@ QgsWFSFeatureDownloader::~QgsWFSFeatureDownloader()

void QgsWFSFeatureDownloader::stop()
{
QgsDebugMsg( "QgsWFSFeatureDownloader::stop()" );
QgsDebugMsgLevel( QStringLiteral( "QgsWFSFeatureDownloader::stop()" ), 4 );
mStop = true;
emit doStop();
}

void QgsWFSFeatureDownloader::setStopFlag()
{
QgsDebugMsg( "QgsWFSFeatureDownloader::setStopFlag()" );
QgsDebugMsgLevel( QStringLiteral( "QgsWFSFeatureDownloader::setStopFlag()" ), 4 );
mStop = true;
}

Expand Down Expand Up @@ -633,7 +633,7 @@ void QgsWFSFeatureDownloader::run( bool serializeFeatures, int maxFeatures )
if ( mShared->mCapabilityExtent.contains( invertedRectangle ) )
{
mShared->mGetFeatureEPSGDotHonoursEPSGOrder = true;
QgsDebugMsg( "Server is likely MapServer. Using mGetFeatureEPSGDotHonoursEPSGOrder mode" );
QgsDebugMsg( QStringLiteral( "Server is likely MapServer. Using mGetFeatureEPSGDotHonoursEPSGOrder mode" ) );
}
}
}
Expand All @@ -651,7 +651,7 @@ void QgsWFSFeatureDownloader::run( bool serializeFeatures, int maxFeatures )
gmlId = QgsWFSUtils::getMD5( f );
if ( !mShared->mHasWarnedAboutMissingFeatureId )
{
QgsDebugMsg( "Server returns features without fid/gml:id. Computing a fake one using feature attributes" );
QgsDebugMsg( QStringLiteral( "Server returns features without fid/gml:id. Computing a fake one using feature attributes" ) );
mShared->mHasWarnedAboutMissingFeatureId = true;
}
}
Expand All @@ -662,7 +662,7 @@ void QgsWFSFeatureDownloader::run( bool serializeFeatures, int maxFeatures )
else if ( pagingIter == 2 && featureCountForThisResponse == 0 && gmlIdFirstFeatureFirstIter == gmlId )
{
disablePaging = true;
QgsDebugMsg( "Server does not seem to properly support paging since it returned the same first feature for 2 different page requests. Disabling paging" );
QgsDebugMsg( QStringLiteral( "Server does not seem to properly support paging since it returned the same first feature for 2 different page requests. Disabling paging" ) );
}

if ( mShared->mGetFeatureEPSGDotHonoursEPSGOrder && f.hasGeometry() )
Expand Down Expand Up @@ -878,7 +878,7 @@ QgsWFSFeatureIterator::QgsWFSFeatureIterator( QgsWFSFeatureSource *source,
if ( !mShared->mCacheDataProvider )
return;

QgsDebugMsg( QString( "QgsWFSFeatureIterator::constructor(): genCounter=%1 " ).arg( genCounter ) );
QgsDebugMsgLevel( QStringLiteral( "QgsWFSFeatureIterator::constructor(): genCounter=%1 " ).arg( genCounter ), 4 );

mCacheIterator = mShared->mCacheDataProvider->getFeatures( buildRequestCache( genCounter ) );
}
Expand Down Expand Up @@ -966,7 +966,7 @@ QgsFeatureRequest QgsWFSFeatureIterator::buildRequestCache( int genCounter )

QgsWFSFeatureIterator::~QgsWFSFeatureIterator()
{
QgsDebugMsg( QString( "qgsWFSFeatureIterator::~QgsWFSFeatureIterator()" ) );
QgsDebugMsgLevel( QStringLiteral( "qgsWFSFeatureIterator::~QgsWFSFeatureIterator()" ), 4 );

close();

Expand Down Expand Up @@ -1018,7 +1018,7 @@ void QgsWFSFeatureIterator::setInterruptionChecker( QgsFeedback *interruptionChe
// if it goes above a given threshold, on disk
void QgsWFSFeatureIterator::featureReceivedSynchronous( const QVector<QgsWFSFeatureGmlIdPair> &list )
{
QgsDebugMsg( QString( "QgsWFSFeatureIterator::featureReceivedSynchronous %1 features" ).arg( list.size() ) );
QgsDebugMsgLevel( QStringLiteral( "QgsWFSFeatureIterator::featureReceivedSynchronous %1 features" ).arg( list.size() ), 4 );
QMutexLocker locker( &mMutex );
if ( !mWriterStream )
{
Expand All @@ -1034,11 +1034,11 @@ void QgsWFSFeatureIterator::featureReceivedSynchronous( const QVector<QgsWFSFeat
thisStr.sprintf( "%p", this );
++ mCounter;
mWriterFilename = QDir( QgsWFSUtils::acquireCacheDirectory() ).filePath( QStringLiteral( "iterator_%1_%2.bin" ).arg( thisStr ).arg( mCounter ) );
QgsDebugMsg( QString( "Transferring feature iterator cache to %1" ).arg( mWriterFilename ) );
QgsDebugMsgLevel( QStringLiteral( "Transferring feature iterator cache to %1" ).arg( mWriterFilename ), 4 );
mWriterFile = new QFile( mWriterFilename );
if ( !mWriterFile->open( QIODevice::WriteOnly | QIODevice::Truncate ) )
{
QgsDebugMsg( QString( "Cannot open %1 for writing" ).arg( mWriterFilename ) );
QgsDebugMsg( QStringLiteral( "Cannot open %1 for writing" ).arg( mWriterFilename ) );
delete mWriterFile;
mWriterFile = nullptr;
return;
Expand Down Expand Up @@ -1105,7 +1105,7 @@ bool QgsWFSFeatureIterator::fetchFeature( QgsFeature &f )
}
catch ( const QgsWkbException & )
{
QgsDebugMsg( QString( "Invalid WKB for cached feature %1" ).arg( cachedFeature.id() ) );
QgsDebugMsg( QStringLiteral( "Invalid WKB for cached feature %1" ).arg( cachedFeature.id() ) );
delete[] wkbClone;
cachedFeature.clearGeometry();
}
Expand Down Expand Up @@ -1164,7 +1164,7 @@ bool QgsWFSFeatureIterator::fetchFeature( QgsFeature &f )
mReaderFile = new QFile( mReaderFilename );
if ( !mReaderFile->open( QIODevice::ReadOnly ) )
{
QgsDebugMsg( QString( "Cannot open %1" ).arg( mReaderFilename ) );
QgsDebugMsg( QStringLiteral( "Cannot open %1" ).arg( mReaderFilename ) );
delete mReaderFile;
mReaderFile = nullptr;
return false;
Expand Down Expand Up @@ -1280,7 +1280,7 @@ bool QgsWFSFeatureIterator::close()
{
if ( mClosed )
return false;
QgsDebugMsg( QString( "qgsWFSFeatureIterator::close()" ) );
QgsDebugMsgLevel( QStringLiteral( "qgsWFSFeatureIterator::close()" ), 4 );

iteratorClosed();

Expand Down

0 comments on commit ee7cfcc

Please sign in to comment.