Skip to content
Permalink
Browse files

Quiet noisy wfs provider debug messages

  • Loading branch information
nyalldawson committed Aug 17, 2018
1 parent 19c1a4b commit 91572beaba3eba731ea0706a5dcb9a6225285502
@@ -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;
@@ -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) */ )
@@ -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 */ )
@@ -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" ) ||
@@ -242,7 +242,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( !value.isNull() && value.text() == QLatin1String( "TRUE" ) )
{
mCaps.supportsJoins = true;
QgsDebugMsg( "Supports joins" );
QgsDebugMsg( QStringLiteral( "Supports joins" ) );
}
}
}
@@ -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;
}
@@ -305,7 +305,7 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()
if ( value.text() == QLatin1String( "hits" ) )
{
mCaps.supportsHits = true;
QgsDebugMsg( "Support hits" );
QgsDebugMsg( QStringLiteral( "Support hits" ) );
break;
}
}
@@ -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 );
@@ -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;
}
}
@@ -50,10 +50,10 @@ QgsWfsConnection::QgsWfsConnection( const QString &connName )
{
mUri.removeParam( QgsWFSConstants::URI_PARAM_PAGING_ENABLED ); // setParam allow for duplicates!
mUri.setParam( QgsWFSConstants::URI_PARAM_PAGING_ENABLED,
settings.value( key + "/" + QgsWFSConstants::SETTINGS_PAGING_ENABLED, true ).toBool() ? "true" : "false" );
settings.value( key + "/" + QgsWFSConstants::SETTINGS_PAGING_ENABLED, true ).toBool() ? QStringLiteral( "true" ) : QStringLiteral( "false" ) );
}

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

QStringList QgsWfsConnection::connectionList()
@@ -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)
@@ -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 ) );
}
@@ -104,14 +104,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;
}

@@ -578,14 +578,14 @@ void QgsWFSFeatureDownloader::run( bool serializeFeatures, int maxFeatures )
if ( mPageSize > 0 && mTotalDownloadedFeatureCount == 0 &&
parser->exceptionText().contains( QLatin1String( "Cannot do natural order without a primary key" ) ) )
{
QgsDebugMsg( QString( "Got exception %1. Re-trying with paging disabled" ).arg( parser->exceptionText() ) );
QgsDebugMsg( QStringLiteral( "Got exception %1. Re-trying with paging disabled" ).arg( parser->exceptionText() ) );
mPageSize = 0;
}
// GeoServer doesn't like typenames prefixed by namespace prefix, despite
// the examples in the WFS 2.0 spec showing that
else if ( !mRemoveNSPrefix && parser->exceptionText().contains( QLatin1String( "more than one feature type" ) ) )
{
QgsDebugMsg( QString( "Got exception %1. Re-trying by removing namespace prefix" ).arg( parser->exceptionText() ) );
QgsDebugMsg( QStringLiteral( "Got exception %1. Re-trying by removing namespace prefix" ).arg( parser->exceptionText() ) );
mRemoveNSPrefix = true;
}

@@ -673,7 +673,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" ) );
}
}
}
@@ -691,7 +691,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;
}
}
@@ -702,7 +702,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() )
@@ -919,7 +919,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 ) );
}
@@ -1007,7 +1007,7 @@ QgsFeatureRequest QgsWFSFeatureIterator::buildRequestCache( int genCounter )

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

close();

@@ -1059,7 +1059,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 )
{
@@ -1075,11 +1075,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;
@@ -1146,7 +1146,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();
}
@@ -1205,7 +1205,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;
@@ -1321,7 +1321,7 @@ bool QgsWFSFeatureIterator::close()
{
if ( mClosed )
return false;
QgsDebugMsg( QString( "qgsWFSFeatureIterator::close()" ) );
QgsDebugMsgLevel( QStringLiteral( "qgsWFSFeatureIterator::close()" ), 4 );

iteratorClosed();

0 comments on commit 91572be

Please sign in to comment.
You can’t perform that action at this time.