Skip to content
Permalink
Browse files

Less debug noise

  • Loading branch information
nyalldawson committed May 14, 2020
1 parent a192e55 commit c3cd2727134b75f82a2ff4f9a7c17dacd0c08cc2
@@ -173,17 +173,17 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
return true;
mAuthInit = true;

QgsDebugMsg( QStringLiteral( "Initializing QCA..." ) );
QgsDebugMsgLevel( QStringLiteral( "Initializing QCA..." ), 2 );
mQcaInitializer = qgis::make_unique<QCA::Initializer>( QCA::Practical, 256 );

QgsDebugMsg( QStringLiteral( "QCA initialized." ) );
QgsDebugMsgLevel( QStringLiteral( "QCA initialized." ), 2 );
QCA::scanForPlugins();

QgsDebugMsg( QStringLiteral( "QCA Plugin Diagnostics Context: %1" ).arg( QCA::pluginDiagnosticText() ) );
QgsDebugMsgLevel( QStringLiteral( "QCA Plugin Diagnostics Context: %1" ).arg( QCA::pluginDiagnosticText() ), 2 );
QStringList capabilities;

capabilities = QCA::supportedFeatures();
QgsDebugMsg( QStringLiteral( "QCA supports: %1" ).arg( capabilities.join( "," ) ) );
QgsDebugMsgLevel( QStringLiteral( "QCA supports: %1" ).arg( capabilities.join( "," ) ), 2 );

// do run-time check for qca-ossl plugin
if ( !QCA::isSupported( "cert", QStringLiteral( "qca-ossl" ) ) )
@@ -193,7 +193,7 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
return isDisabled();
}

QgsDebugMsg( QStringLiteral( "Prioritizing qca-ossl over all other QCA providers..." ) );
QgsDebugMsgLevel( QStringLiteral( "Prioritizing qca-ossl over all other QCA providers..." ), 2 );
const QCA::ProviderList provds = QCA::providers();
QStringList prlist;
for ( QCA::Provider *p : provds )
@@ -207,14 +207,14 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
QCA::setProviderPriority( pn, pr );
prlist << QStringLiteral( "%1:%2" ).arg( pn ).arg( QCA::providerPriority( pn ) );
}
QgsDebugMsg( QStringLiteral( "QCA provider priorities: %1" ).arg( prlist.join( ", " ) ) );
QgsDebugMsgLevel( QStringLiteral( "QCA provider priorities: %1" ).arg( prlist.join( ", " ) ), 2 );

QgsDebugMsg( QStringLiteral( "Populating auth method registry" ) );
QgsDebugMsgLevel( QStringLiteral( "Populating auth method registry" ), 3 );
QgsAuthMethodRegistry *authreg = QgsAuthMethodRegistry::instance( pluginPath );

QStringList methods = authreg->authMethodList();

QgsDebugMsg( QStringLiteral( "Authentication methods found: %1" ).arg( methods.join( ", " ) ) );
QgsDebugMsgLevel( QStringLiteral( "Authentication methods found: %1" ).arg( methods.join( ", " ) ), 2 );

if ( methods.isEmpty() )
{
@@ -231,15 +231,15 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
}

mAuthDbPath = QDir::cleanPath( authDatabasePath );
QgsDebugMsg( QStringLiteral( "Auth database path: %1" ).arg( authenticationDatabasePath() ) );
QgsDebugMsgLevel( QStringLiteral( "Auth database path: %1" ).arg( authenticationDatabasePath() ), 2 );

QFileInfo dbinfo( authenticationDatabasePath() );
QFileInfo dbdirinfo( dbinfo.path() );
QgsDebugMsg( QStringLiteral( "Auth db directory path: %1" ).arg( dbdirinfo.filePath() ) );
QgsDebugMsgLevel( QStringLiteral( "Auth db directory path: %1" ).arg( dbdirinfo.filePath() ), 2 );

if ( !dbdirinfo.exists() )
{
QgsDebugMsg( QStringLiteral( "Auth db directory path does not exist, making path: %1" ).arg( dbdirinfo.filePath() ) );
QgsDebugMsgLevel( QStringLiteral( "Auth db directory path does not exist, making path: %1" ).arg( dbdirinfo.filePath() ), 2 );
if ( !QDir().mkpath( dbdirinfo.filePath() ) )
{
const char *err = QT_TR_NOOP( "Auth db directory path could not be created" );
@@ -260,7 +260,7 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
}
if ( dbinfo.size() > 0 )
{
QgsDebugMsg( QStringLiteral( "Auth db exists and has data" ) );
QgsDebugMsgLevel( QStringLiteral( "Auth db exists and has data" ), 2 );

if ( !createCertTables() )
return false;
@@ -299,7 +299,7 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
{
if ( setMasterPassword( masterpass, true ) )
{
QgsDebugMsg( QStringLiteral( "Authentication master password set from QGIS_AUTH_PASSWORD_FILE" ) );
QgsDebugMsgLevel( QStringLiteral( "Authentication master password set from QGIS_AUTH_PASSWORD_FILE" ), 2 );
}
else
{
@@ -319,7 +319,7 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
}
else
{
QgsDebugMsg( QStringLiteral( "Auth db does not exist: creating through QSqlDatabase initial connection" ) );
QgsDebugMsgLevel( QStringLiteral( "Auth db does not exist: creating through QSqlDatabase initial connection" ), 2 );

if ( !createConfigTables() )
return false;
@@ -392,7 +392,7 @@ bool QgsAuthManager::createCertTables()
{
QMutexLocker locker( mMutex.get() );
// NOTE: these tables were added later, so IF NOT EXISTS is used
QgsDebugMsg( QStringLiteral( "Creating cert tables in auth db" ) );
QgsDebugMsgLevel( QStringLiteral( "Creating cert tables in auth db" ), 2 );

QSqlQuery query( authDatabaseConnection() );

@@ -1699,7 +1699,8 @@ bool QgsAuthManager::initSslCaches()
mCustomConfigByHostCache.clear();
mHasCheckedIfCustomConfigByHostExists = false;

QgsDebugMsg( QStringLiteral( "Init of SSL caches %1" ).arg( res ? "SUCCEEDED" : "FAILED" ) );
if ( !res )
QgsDebugMsg( QStringLiteral( "Init of SSL caches FAILED" ) );
return res;
}

@@ -1743,7 +1744,7 @@ bool QgsAuthManager::storeCertIdentity( const QSslCertificate &cert, const QSslK
if ( !authDbCommit() )
return false;

QgsDebugMsg( QStringLiteral( "Store certificate identity SUCCESS for id: %1" ).arg( id ) );
QgsDebugMsgLevel( QStringLiteral( "Store certificate identity SUCCESS for id: %1" ).arg( id ), 2 );
return true;
}

@@ -2240,7 +2241,7 @@ void QgsAuthManager::dumpIgnoredSslErrorsCache_()
}
else
{
QgsDebugMsg( QStringLiteral( "Ignored SSL errors cache EMPTY" ) );
QgsDebugMsgLevel( QStringLiteral( "Ignored SSL errors cache EMPTY" ), 2 );
}
}

@@ -2368,12 +2369,12 @@ bool QgsAuthManager::rebuildIgnoredSslErrorCache()
{
mIgnoredSslErrorsCache.clear();
mIgnoredSslErrorsCache = nextcache;
QgsDebugMsg( QStringLiteral( "Rebuild of ignored SSL errors cache SUCCEEDED" ) );
QgsDebugMsgLevel( QStringLiteral( "Rebuild of ignored SSL errors cache SUCCEEDED" ), 2 );
dumpIgnoredSslErrorsCache_();
return true;
}

QgsDebugMsg( QStringLiteral( "Rebuild of ignored SSL errors cache SAME AS BEFORE" ) );
QgsDebugMsgLevel( QStringLiteral( "Rebuild of ignored SSL errors cache SAME AS BEFORE" ), 2 );
dumpIgnoredSslErrorsCache_();
return true;
}
@@ -2614,7 +2615,8 @@ bool QgsAuthManager::rebuildCaCertsCache()
insertCaCertInCache( QgsAuthCertUtils::InDatabase, databaseCAs() );

bool res = !mCaCertsCache.isEmpty(); // should at least contain system root CAs
QgsDebugMsg( QStringLiteral( "Rebuild of CA certs cache %1" ).arg( res ? "SUCCEEDED" : "FAILED" ) );
if ( !res )
QgsDebugMsg( QStringLiteral( "Rebuild of CA certs cache FAILED" ) );
return res;
}

@@ -2819,7 +2821,7 @@ bool QgsAuthManager::rebuildCertTrustCache()
}
}

QgsDebugMsg( QStringLiteral( "Rebuild of cert trust policy cache SUCCEEDED" ) );
QgsDebugMsgLevel( QStringLiteral( "Rebuild of cert trust policy cache SUCCEEDED" ), 2 );
return true;
}

@@ -2887,7 +2889,7 @@ bool QgsAuthManager::rebuildTrustedCaCertsCache()
{
QMutexLocker locker( mMutex.get() );
mTrustedCaCertsCache = trustedCaCerts();
QgsDebugMsg( QStringLiteral( "Rebuilt trusted cert authorities cache" ) );
QgsDebugMsgLevel( QStringLiteral( "Rebuilt trusted cert authorities cache" ), 2 );
// TODO: add some error trapping for the operation
return true;
}
@@ -63,7 +63,7 @@ QgsAuthMethodRegistry::QgsAuthMethodRegistry( const QString &pluginPath )
mLibraryDirectory.setNameFilters( QStringList( QStringLiteral( "*authmethod.so" ) ) );
#endif

QgsDebugMsg( QStringLiteral( "Checking for auth method plugins in: %1" ).arg( mLibraryDirectory.path() ) );
QgsDebugMsgLevel( QStringLiteral( "Checking for auth method plugins in: %1" ).arg( mLibraryDirectory.path() ), 2 );

if ( mLibraryDirectory.count() == 0 )
{
@@ -286,7 +286,7 @@ std::unique_ptr<QgsAuthMethod> QgsAuthMethodRegistry::authMethod( const QString
// load the auth method
QLibrary myLib( lib );

QgsDebugMsg( "Auth method library name is " + myLib.fileName() );
QgsDebugMsgLevel( "Auth method library name is " + myLib.fileName(), 2 );
if ( !myLib.load() )
{
QgsMessageLog::logMessage( QObject::tr( "Failed to load %1: %2" ).arg( lib, myLib.errorString() ) );
@@ -308,7 +308,7 @@ std::unique_ptr<QgsAuthMethod> QgsAuthMethodRegistry::authMethod( const QString
return nullptr;
}

QgsDebugMsg( QStringLiteral( "Instantiated the auth method plugin: %1" ).arg( authMethod->key() ) );
QgsDebugMsgLevel( QStringLiteral( "Instantiated the auth method plugin: %1" ).arg( authMethod->key() ), 2 );
return authMethod;
}

@@ -3284,7 +3284,7 @@ QString createFilters( const QString &type )
{
// NOP, we don't know anything about the current driver
// with regards to a proper file filter string
QgsDebugMsg( QStringLiteral( "Unknown driver %1 for file filters." ).arg( driverName ) );
QgsDebugMsgLevel( QStringLiteral( "Unknown driver %1 for file filters." ).arg( driverName ), 2 );
}
}

@@ -162,7 +162,7 @@ QgsApplication::QgsApplication( int &argc, char **argv, bool GUIenabled, const Q
}
else
{
QgsDebugMsg( QStringLiteral( "loading of qgis translation failed %1/qgis_%2" ).arg( i18nPath(), *sTranslation() ) );
QgsDebugMsgLevel( QStringLiteral( "loading of qgis translation failed %1/qgis_%2" ).arg( i18nPath(), *sTranslation() ), 2 );
}

/* Translation file for Qt.
@@ -177,7 +177,7 @@ QgsApplication::QgsApplication( int &argc, char **argv, bool GUIenabled, const Q
}
else
{
QgsDebugMsg( QStringLiteral( "loading of qt translation failed %1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), *sTranslation() ) );
QgsDebugMsgLevel( QStringLiteral( "loading of qt translation failed %1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), *sTranslation() ), 2 );
}
}

@@ -1693,8 +1693,8 @@ void QgsApplication::applyGdalSkippedDrivers()
realDisabledDriverList << driverName;
}
QString myDriverList = realDisabledDriverList.join( ' ' );
QgsDebugMsgLevel( QStringLiteral( "Gdal Skipped driver list set to:" ), 1 );
QgsDebugMsgLevel( myDriverList, 1 );
QgsDebugMsgLevel( QStringLiteral( "Gdal Skipped driver list set to:" ), 2 );
QgsDebugMsgLevel( myDriverList, 2 );
CPLSetConfigOption( "GDAL_SKIP", myDriverList.toUtf8() );
GDALAllRegister(); //to update driver list and skip missing ones
}
@@ -200,7 +200,7 @@ void QgsProviderRegistry::init()
factory_function *function = reinterpret_cast< factory_function * >( cast_to_fptr( func ) );
if ( !function )
{
QgsDebugMsg( QStringLiteral( "Checking %1: ...invalid (no providerMetadataFactory method)" ).arg( myLib.fileName() ) );
QgsDebugMsgLevel( QStringLiteral( "Checking %1: ...invalid (no providerMetadataFactory method)" ).arg( myLib.fileName() ), 2 );
continue;
}

@@ -38,7 +38,7 @@ QgsOracleConn *QgsOracleConn::connectDb( const QgsDataSourceUri &uri, bool trans
{
if ( sConnections.contains( conninfo ) )
{
QgsDebugMsg( QStringLiteral( "Using cached connection for %1" ).arg( conninfo ) );
QgsDebugMsgLevel( QStringLiteral( "Using cached connection for %1" ).arg( conninfo ), 2 );
sConnections[conninfo]->mRef++;
return sConnections[conninfo];
}
@@ -67,12 +67,12 @@ QgsOracleConn::QgsOracleConn( QgsDataSourceUri uri, bool transaction )
, mLock( QMutex::Recursive )
, mTransaction( transaction )
{
QgsDebugMsg( QStringLiteral( "New Oracle connection for " ) + uri.connectionInfo( false ) );
QgsDebugMsgLevel( QStringLiteral( "New Oracle connection for " ) + uri.connectionInfo( false ), 2 );

uri = QgsDataSourceUri( uri.connectionInfo( true ) );

QString database = databaseName( uri.database(), uri.host(), uri.port() );
QgsDebugMsg( QStringLiteral( "New Oracle database " ) + database );
QgsDebugMsgLevel( QStringLiteral( "New Oracle database " ) + database, 2 );

mDatabase = QSqlDatabase::addDatabase( QStringLiteral( "QOCISPATIAL" ), QStringLiteral( "oracle%1" ).arg( snConnections++ ) );
mDatabase.setDatabaseName( database );
@@ -105,7 +105,7 @@ QgsOracleConn::QgsOracleConn( QgsDataSourceUri uri, bool transaction )
}
}

QgsDebugMsg( QStringLiteral( "Connecting with options: " ) + options );
QgsDebugMsgLevel( QStringLiteral( "Connecting with options: " ) + options, 2 );
if ( !mDatabase.open() )
{
QgsCredentials::instance()->lock();
@@ -132,7 +132,7 @@ QgsOracleConn::QgsOracleConn( QgsDataSourceUri uri, bool transaction )
if ( !password.isEmpty() )
uri.setPassword( password );

QgsDebugMsg( "Connecting to " + database );
QgsDebugMsgLevel( "Connecting to " + database, 2 );
mDatabase.setUserName( username );
mDatabase.setPassword( password );
}
@@ -610,7 +610,7 @@ void QgsOracleConn::retrieveLayerTypes( QgsOracleLayerProperty &layerProperty, b
tr( "Oracle" ) );
continue;
}
QgsDebugMsg( QStringLiteral( "add type %1" ).arg( type ) );
QgsDebugMsgLevel( QStringLiteral( "add type %1" ).arg( type ), 2 );
layerProperty.types << type;
}
else
@@ -630,8 +630,6 @@ void QgsOracleConn::retrieveLayerTypes( QgsOracleLayerProperty &layerProperty, b
layerProperty.types << QgsWkbTypes::Unknown;
layerProperty.srids << ( srids.size() == 1 ? *srids.constBegin() : 0 );
}

QgsDebugMsg( QStringLiteral( "leaving." ) );
}

QString QgsOracleConn::databaseTypeFilter( const QString &alias, QString geomCol, QgsWkbTypes::Type geomType )
@@ -682,7 +680,7 @@ QString QgsOracleConn::databaseTypeFilter( const QString &alias, QString geomCol

QgsWkbTypes::Type QgsOracleConn::wkbTypeFromDatabase( int gtype )
{
QgsDebugMsg( QStringLiteral( "entering %1" ).arg( gtype ) );
QgsDebugMsgLevel( QStringLiteral( "entering %1" ).arg( gtype ), 2 );
int t = gtype % 100;

if ( t == 0 )
@@ -143,7 +143,7 @@ QgsOracleFeatureIterator::QgsOracleFeatureIterator( QgsOracleFeatureSource *sour
}
else if ( !mFilterRect.isNull() )
{
QgsDebugMsg( QStringLiteral( "filterRect without geometry ignored" ) );
QgsDebugMsgLevel( QStringLiteral( "filterRect without geometry ignored" ), 2 );
}

switch ( mRequest.filterType() )
@@ -511,7 +511,7 @@ bool QgsOracleFeatureIterator::openQuery( const QString &whereClause, const QVar
if ( !whereClause.isEmpty() )
query += QStringLiteral( " WHERE %1" ).arg( whereClause );

QgsDebugMsg( QStringLiteral( "Fetch features: %1" ).arg( query ) );
QgsDebugMsgLevel( QStringLiteral( "Fetch features: %1" ).arg( query ), 2 );
mSql = query;
mArgs = args;
if ( !execQuery( query, args, 1 ) )

0 comments on commit c3cd272

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