Skip to content

Commit

Permalink
Silence some more noisy debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 28, 2020
1 parent 0801d0b commit 12ff1b3
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/app/labeling/qgsmaptoolpinlabels.cpp
Expand Up @@ -319,7 +319,7 @@ bool QgsMapToolPinLabels::pinUnpinCurrentLabel( bool pin )

if ( !currentLabelDataDefinedPosition( xPosOrig, xSuccess, yPosOrig, ySuccess, xCol, yCol ) )
{
QgsDebugMsg( QStringLiteral( "Label X or Y column not mapped, skipping" ) );
QgsDebugMsgLevel( QStringLiteral( "Label X or Y column not mapped, skipping" ), 2 );
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -5288,7 +5288,7 @@ bool QgisApp::addVectorLayersPrivate( const QStringList &layerQStringList, const
layer->setProviderEncoding( enc );

QStringList sublayers = layer->dataProvider()->subLayers();
QgsDebugMsg( QStringLiteral( "got valid layer with %1 sublayers" ).arg( sublayers.count() ) );
QgsDebugMsgLevel( QStringLiteral( "got valid layer with %1 sublayers" ).arg( sublayers.count() ), 2 );

// If the newly created layer has more than 1 layer of data available, we show the
// sublayers selection dialog so the user can select the sublayers to actually load.
Expand Down Expand Up @@ -7117,7 +7117,7 @@ void QgisApp::openFile( const QString &fileName, const QString &fileTypeHint )
}
else
{
QgsDebugMsg( "Adding " + fileName + " to the map canvas" );
QgsDebugMsgLevel( "Adding " + fileName + " to the map canvas", 2 );
openLayer( fileName, true );
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -1109,7 +1109,9 @@ void QgsIdentifyResultsDialog::editingToggled()

int j;
for ( j = 0; j < featItem->childCount() && featItem->child( j )->data( 0, Qt::UserRole ).toString() != QLatin1String( "actions" ); j++ )
QgsDebugMsg( QStringLiteral( "%1: skipped %2" ).arg( featItem->child( j )->data( 0, Qt::UserRole ).toString() ) );
{
QgsDebugMsgLevel( QStringLiteral( "%1: skipped %2" ).arg( featItem->child( j )->data( 0, Qt::UserRole ).toString() ), 2 );
}

if ( j == featItem->childCount() || featItem->child( j )->childCount() < 1 )
continue;
Expand Down Expand Up @@ -1677,11 +1679,11 @@ void QgsIdentifyResultsDialog::layerDestroyed()
// remove items, starting from last
for ( int i = tblResults->rowCount() - 1; i >= 0; i-- )
{
QgsDebugMsg( QStringLiteral( "item %1 / %2" ).arg( i ).arg( tblResults->rowCount() ) );
QgsDebugMsgLevel( QStringLiteral( "item %1 / %2" ).arg( i ).arg( tblResults->rowCount() ), 3 );
QTableWidgetItem *layItem = tblResults->item( i, 0 );
if ( layItem && layItem->data( Qt::UserRole ).value<QObject *>() == senderObject )
{
QgsDebugMsg( QStringLiteral( "removing row %1" ).arg( i ) );
QgsDebugMsgLevel( QStringLiteral( "removing row %1" ).arg( i ), 3 );
tblResults->removeRow( i );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolselectutils.cpp
Expand Up @@ -293,7 +293,7 @@ QgsFeatureIds QgsMapToolSelectUtils::getMatchingFeatures( QgsMapCanvas *canvas,
if ( r )
r->stopRender( context );

QgsDebugMsg( "Number of new selected features: " + QString::number( newSelectedFeatures.size() ) );
QgsDebugMsgLevel( "Number of new selected features: " + QString::number( newSelectedFeatures.size() ), 2 );

return newSelectedFeatures;
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -156,7 +156,7 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, const ProviderOptions &opt
mGeoTransform[4] = 0;
mGeoTransform[5] = -1;

QgsDebugMsgLevel( "constructing with uri '" + uri + "'.", 1 );
QgsDebugMsgLevel( "constructing with uri '" + uri + "'.", 2 );

QgsGdalProviderBase::registerGdalDrivers();

Expand Down Expand Up @@ -306,15 +306,15 @@ bool QgsGdalProvider::crsFromWkt( const char *wkt )
QString authid = QStringLiteral( "%1:%2" )
.arg( OSRGetAuthorityName( hCRS, nullptr ),
OSRGetAuthorityCode( hCRS, nullptr ) );
QgsDebugMsgLevel( "authid recognized as " + authid, 1 );
QgsDebugMsgLevel( "authid recognized as " + authid, 2 );
mCrs = QgsCoordinateReferenceSystem::fromOgcWmsCrs( authid );
}
else
{
// get the proj4 text
char *pszProj4 = nullptr;
OSRExportToProj4( hCRS, &pszProj4 );
QgsDebugMsgLevel( pszProj4, 1 );
QgsDebugMsgLevel( pszProj4, 2 );
CPLFree( pszProj4 );

char *pszWkt = nullptr;
Expand Down Expand Up @@ -2637,7 +2637,7 @@ bool QgsGdalProvider::initIfNeeded()
return false;
}

QgsDebugMsg( QStringLiteral( "GdalDataset opened" ) );
QgsDebugMsgLevel( QStringLiteral( "GdalDataset opened" ), 2 );

initBaseDataset();
return mValid;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgspointlocator.cpp
Expand Up @@ -690,7 +690,7 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
QElapsedTimer t;
t.start();

QgsDebugMsg( QStringLiteral( "RebuildIndex start : %1" ).arg( mSource->id() ) );
QgsDebugMsgLevel( QStringLiteral( "RebuildIndex start : %1" ).arg( mSource->id() ), 2 );

destroyIndex();

Expand Down Expand Up @@ -810,7 +810,7 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
mRenderer->stopRender( *ctx );
}

QgsDebugMsg( QStringLiteral( "RebuildIndex end : %1 ms (%2)" ).arg( t.elapsed() ).arg( mSource->id() ) );
QgsDebugMsgLevel( QStringLiteral( "RebuildIndex end : %1 ms (%2)" ).arg( t.elapsed() ).arg( mSource->id() ), 2 );

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsproject.cpp
Expand Up @@ -1558,8 +1558,8 @@ bool QgsProject::readProjectFile( const QString &filename, QgsProject::ReadFlags
if ( clean )
setDirty( false );

QgsDebugMsg( QString( "Project save user: %1" ).arg( mSaveUser ) );
QgsDebugMsg( QString( "Project save user: %1" ).arg( mSaveUserFull ) );
QgsDebugMsgLevel( QString( "Project save user: %1" ).arg( mSaveUser ), 2 );
QgsDebugMsgLevel( QString( "Project save user: %1" ).arg( mSaveUserFull ), 2 );

Q_NOWARN_DEPRECATED_PUSH
emit nonIdentifiableLayersChanged( nonIdentifiableLayers() );
Expand Down Expand Up @@ -2138,7 +2138,7 @@ bool QgsProject::writeProjectFile( const QString &filename )
dump_( mProperties );
#endif

QgsDebugMsgLevel( QStringLiteral( "there are %1 property scopes" ).arg( static_cast<int>( mProperties.count() ) ), 1 );
QgsDebugMsgLevel( QStringLiteral( "there are %1 property scopes" ).arg( static_cast<int>( mProperties.count() ) ), 2 );

if ( !mProperties.isEmpty() ) // only worry about properties if we
// actually have any properties
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectordataprovider.cpp
Expand Up @@ -199,7 +199,8 @@ void QgsVectorDataProvider::setEncoding( const QString &e )

if ( !mEncoding && e != QLatin1String( "System" ) )
{
QgsMessageLog::logMessage( tr( "Codec %1 not found. Falling back to system locale" ).arg( e ) );
if ( !e.isEmpty() )
QgsMessageLog::logMessage( tr( "Codec %1 not found. Falling back to system locale" ).arg( e ) );
mEncoding = QTextCodec::codecForName( "System" );
}

Expand Down
10 changes: 5 additions & 5 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -409,11 +409,11 @@ bool QgsAttributeForm::saveEdits()
continue;
}

QgsDebugMsg( QStringLiteral( "Updating field %1" ).arg( i ) );
QgsDebugMsg( QStringLiteral( "dst:'%1' (type:%2, isNull:%3, isValid:%4)" )
.arg( dst.at( i ).toString(), dst.at( i ).typeName() ).arg( dst.at( i ).isNull() ).arg( dst.at( i ).isValid() ) );
QgsDebugMsg( QStringLiteral( "src:'%1' (type:%2, isNull:%3, isValid:%4)" )
.arg( src.at( i ).toString(), src.at( i ).typeName() ).arg( src.at( i ).isNull() ).arg( src.at( i ).isValid() ) );
QgsDebugMsgLevel( QStringLiteral( "Updating field %1" ).arg( i ), 2 );
QgsDebugMsgLevel( QStringLiteral( "dst:'%1' (type:%2, isNull:%3, isValid:%4)" )
.arg( dst.at( i ).toString(), dst.at( i ).typeName() ).arg( dst.at( i ).isNull() ).arg( dst.at( i ).isValid() ), 2 );
QgsDebugMsgLevel( QStringLiteral( "src:'%1' (type:%2, isNull:%3, isValid:%4)" )
.arg( src.at( i ).toString(), src.at( i ).typeName() ).arg( src.at( i ).isNull() ).arg( src.at( i ).isValid() ), 2 );

newValues[i] = dst.at( i );
oldValues[i] = src.at( i );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscodeeditorpython.cpp
Expand Up @@ -134,7 +134,7 @@ void QgsCodeEditorPython::loadAPIs( const QList<QString> &filenames )

bool QgsCodeEditorPython::loadScript( const QString &script )
{
QgsDebugMsg( QStringLiteral( "The script file: %1" ).arg( script ) );
QgsDebugMsgLevel( QStringLiteral( "The script file: %1" ).arg( script ), 2 );
QFile file( script );
if ( !file.open( QIODevice::ReadOnly ) )
{
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsguiutils.cpp
Expand Up @@ -101,10 +101,10 @@ namespace QgsGuiUtils
}

#ifdef QGISDEBUG
QgsDebugMsg( QStringLiteral( "Available Filters Map: " ) );
QgsDebugMsgLevel( QStringLiteral( "Available Filters Map: " ), 2 );
for ( QMap<QString, QString>::iterator it = filterMap.begin(); it != filterMap.end(); ++it )
{
QgsDebugMsg( it.key() + " : " + it.value() );
QgsDebugMsgLevel( it.key() + " : " + it.value(), 2 );
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptoolidentify.cpp
Expand Up @@ -439,7 +439,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QList<QgsMapToolIdentify::Identify
renderer->stopRender( context );
}

QgsDebugMsg( "Feature count on identify: " + QString::number( featureCount ) );
QgsDebugMsgLevel( "Feature count on identify: " + QString::number( featureCount ), 2 );

QApplication::restoreOverrideCursor();
return featureCount > 0;
Expand Down

0 comments on commit 12ff1b3

Please sign in to comment.