Skip to content

Commit ff198a8

Browse files
author
jef
committedSep 25, 2010
also report provider errors when not debugging
git-svn-id: http://svn.osgeo.org/qgis/trunk@14281 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent da2cfb8 commit ff198a8

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class QgsCPLErrorHandler
5858
{
5959
static void CPL_STDCALL showError( CPLErr errClass, int errNo, const char *msg )
6060
{
61-
QgsDebugMsg( QString( "OGR[%1] error %2: %3" ).arg( errClass ).arg( errNo ).arg( msg ) );
61+
QgsLogger::warning( QString( "OGR[%1] error %2: %3" ).arg( errClass ).arg( errNo ).arg( msg ) );
6262
}
6363

6464
public:
@@ -71,7 +71,6 @@ class QgsCPLErrorHandler
7171
{
7272
CPLPopErrorHandler();
7373
}
74-
7574
};
7675

7776
QgsOgrProvider::QgsOgrProvider( QString const & uri )

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
623623
QString fetch = QString( "fetch forward %1 from %2" ).arg( mFeatureQueueSize ).arg( cursorName );
624624
if ( connectionRO->PQsendQuery( fetch ) == 0 ) // fetch features asynchronously
625625
{
626-
QgsDebugMsg( "PQsendQuery failed" );
626+
QgsLogger::warning( "PQsendQuery failed" );
627627
}
628628

629629
Result queryResult;
@@ -758,7 +758,7 @@ const QgsField &QgsPostgresProvider::field( int index ) const
758758

759759
if ( it == attributeFields.constEnd() )
760760
{
761-
QgsDebugMsg( "Field " + QString::number( index ) + " not found." );
761+
QgsLogger::warning( "Field " + QString::number( index ) + " not found." );
762762
throw PGFieldNotFound();
763763
}
764764

@@ -924,7 +924,7 @@ bool QgsPostgresProvider::loadFields()
924924
}
925925
else
926926
{
927-
QgsDebugMsg( "Field " + fieldName + " ignored, because of unsupported type " + fieldTypeName );
927+
QgsLogger::warning( "Field " + fieldName + " ignored, because of unsupported type " + fieldTypeName );
928928
continue;
929929
}
930930

@@ -943,7 +943,7 @@ bool QgsPostgresProvider::loadFields()
943943
}
944944
else
945945
{
946-
QgsDebugMsg( "Field " + fieldName + " ignored, because of unsupported type type " + fieldTType );
946+
QgsLogger::warning( "Field " + fieldName + " ignored, because of unsupported type type " + fieldTType );
947947
continue;
948948
}
949949

@@ -3307,13 +3307,11 @@ bool QgsPostgresProvider::Conn::PQexecNR( QString query )
33073307
if ( errorStatus == PGRES_COMMAND_OK )
33083308
return true;
33093309

3310-
#ifdef QGISDEBUG
3311-
QString err = QString( "Query: %1 returned %2 [%3]" )
3312-
.arg( query )
3313-
.arg( errorStatus )
3314-
.arg( QString::fromUtf8( PQresultErrorMessage( res ) ) );
3315-
QgsDebugMsg( err );
3316-
#endif
3310+
QgsLogger::warning( QString( "Query: %1 returned %2 [%3]" )
3311+
.arg( query )
3312+
.arg( errorStatus )
3313+
.arg( QString::fromUtf8( PQresultErrorMessage( res ) ) ) );
3314+
33173315
if ( openCursors )
33183316
{
33193317
QgsPostgresProvider::showMessageBox(

0 commit comments

Comments
 (0)
Please sign in to comment.