Skip to content
Permalink
Browse files

Quiet noisy wfs provider debug messages

(cherry-picked from 91572be)
  • Loading branch information
nyalldawson committed Aug 17, 2018
1 parent e89412b commit ee7cfcce8f02b2b95c8819fbda00c323df0c3e57
@@ -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;
}
}
@@ -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()
@@ -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 ) );
}
@@ -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;
}

@@ -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" ) );
}
}
}
@@ -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;
}
}
@@ -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() )
@@ -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 ) );
}
@@ -966,7 +966,7 @@ QgsFeatureRequest QgsWFSFeatureIterator::buildRequestCache( int genCounter )

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

close();

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

iteratorClosed();

0 comments on commit ee7cfcc

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