Skip to content

Commit

Permalink
postgres provider: show notices
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 8, 2015
1 parent a264a27 commit b2cfe0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/providers/postgres/qgspostgresconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ QgsPostgresConn *QgsPostgresConn::connectDb( QString conninfo, bool readonly, bo
return conn;
}

static void noticeProcessor( void *arg, const char *message )
{
Q_UNUSED( arg );
QString msg( QString::fromUtf8( message ) );
msg.chop( 1 );
QgsMessageLog::logMessage( QObject::tr( "NOTICE: %1" ).arg( msg ), QObject::tr( "PostGIS" ) );
}

QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared, bool transaction )
: mRef( 1 )
, mOpenCursors( 0 )
Expand Down Expand Up @@ -268,6 +276,8 @@ QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared,
{
QgsDebugMsg( "Topology support available!" );
}

PQsetNoticeProcessor( mConn, noticeProcessor, 0 );
}

QgsPostgresConn::~QgsPostgresConn()
Expand Down

0 comments on commit b2cfe0b

Please sign in to comment.