Skip to content

Commit

Permalink
use QgsDebugMsg
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12427 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 13, 2009
1 parent 59197fc commit 7a0a3fb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void QgsNewConnection::testConnection()
QgsDataSourceURI uri;
uri.setConnection( txtHost->text(), txtPort->text(), txtDatabase->text(), txtUsername->text(), txtPassword->text(), ( QgsDataSourceURI::SSLmode ) cbxSSLmode->currentIndex() );

QgsLogger::debug( "PQconnectdb(" + uri.connectionInfo() + ");" );
QgsDebugMsg( "PQconnectdb(" + uri.connectionInfo() + ");" );

PGconn *pd = PQconnectdb( uri.connectionInfo().toLocal8Bit().data() );
if ( PQstatus( pd ) == CONNECTION_OK )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ bool QgsMapLayer::isValid()

void QgsMapLayer::invalidTransformInput()
{
QgsLogger::warning( "QgsMapLayer::invalidTransformInput() called" );
QgsDebugMsg( "called" );
// TODO: emit a signal - it will be used to update legend
}

Expand Down
33 changes: 13 additions & 20 deletions src/core/qgsmaprenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,10 @@ void QgsMapRenderer::adjustExtentToSize()
dymax = mExtent.yMaximum() + whitespace;
}

#ifdef QGISDEBUG
QString myMessage = "+-------------------MapRenderer--------------------------------+\n";
myMessage += QString( "Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX ).arg( mapUnitsPerPixelY );
myMessage += QString( "Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth ).arg( myHeight );
myMessage += QString( "Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width() ).arg( mExtent.height() );
myMessage += mExtent.toString();
std::cout << myMessage.toLocal8Bit().constData() << std::endl; // OK

#endif

QgsDebugMsg( QString("Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX ).arg( mapUnitsPerPixelY ) );
QgsDebugMsg( QString("Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth ).arg( myHeight ) );
QgsDebugMsg( QString("Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width() ).arg( mExtent.height() ) );
QgsDebugMsg( mExtent.toString() );

// update extent
mExtent.setXMinimum( dxmin );
Expand All @@ -200,9 +194,7 @@ void QgsMapRenderer::adjustExtentToSize()
// update the scale
updateScale();

#ifdef QGISDEBUG
QgsLogger::debug( "Scale (assuming meters as map units) = 1", mScale, 1, __FILE__, __FUNCTION__, __LINE__ );
#endif
QgsDebugMsg( QString("Scale (assuming meters as map units) = 1:%1").arg( mScale ) );

newCoordXForm.setParameters( mMapUnitsPerPixel, dxmin, dymin, myHeight );
mRenderContext.setMapToPixel( newCoordXForm );
Expand All @@ -221,7 +213,7 @@ void QgsMapRenderer::render( QPainter* painter )

if ( mExtent.isEmpty() )
{
QgsLogger::debug( "empty extent... not rendering" );
QgsDebugMsg( "empty extent... not rendering" );
return;
}

Expand Down Expand Up @@ -343,7 +335,7 @@ void QgsMapRenderer::render( QPainter* painter )

if ( !ml )
{
QgsLogger::warning( "Layer not found in registry!" );
QgsDebugMsg( "Layer not found in registry!" );
continue;
}

Expand Down Expand Up @@ -472,8 +464,9 @@ void QgsMapRenderer::render( QPainter* painter )
}
else
{
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
QgsDebugMsg( "Layer rendered without issues" );
}

if ( split )
{
mRenderContext.setExtent( r2 );
Expand Down Expand Up @@ -708,7 +701,7 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsLogger::warning( "Transform error caught in " + QString( __FILE__ ) + ", line " + QString::number( __LINE__ ) );
QgsDebugMsg( "Transform error caught" );
extent = QgsRectangle( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
r2 = QgsRectangle( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
}
Expand Down Expand Up @@ -752,7 +745,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsDebugMsg( QString( "Transform error caught:%s" ).arg( cse.what() ) );
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
}
}
else
Expand All @@ -773,7 +766,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
}
catch ( QgsCsException &cse )
{
QgsDebugMsg( QString( "Transform error caught: %s" ).arg( cse.what() ) );
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
throw cse; //let client classes know there was a transformation error
}
}
Expand Down Expand Up @@ -820,7 +813,7 @@ void QgsMapRenderer::updateFullExtent()
QgsMapLayer * lyr = registry->mapLayer( *it );
if ( lyr == NULL )
{
QgsLogger::warning( "WARNING: layer '" + ( *it ) + "' not found in map layer registry!" );
QgsDebugMsg( QString("WARNING: layer '%1' not found in map layer registry!").arg( *it ) );
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions src/providers/gpx/gpsdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ QgsGPSData* QgsGPSData::getData( const QString& fileName )
return 0;
}
QgsGPSData* data = new QgsGPSData;
QgsLogger::debug( "Loading file " + fileName );
QgsDebugMsg( "Loading file " + fileName );
QgsGPXHandler handler( *data );
bool failed = false;

Expand Down Expand Up @@ -412,7 +412,7 @@ QgsGPSData* QgsGPSData::getData( const QString& fileName )
dataObjects[fileName] = std::pair<QgsGPSData*, unsigned>( data, 0 );
}
else
QgsLogger::debug( fileName + " is already loaded" );
QgsDebugMsg( fileName + " is already loaded" );

// return a pointer and increase the reference count for that file name
DataMap::iterator iter = dataObjects.find( fileName );
Expand All @@ -429,10 +429,10 @@ void QgsGPSData::releaseData( const QString& fileName )
DataMap::iterator iter = dataObjects.find( fileName );
if ( iter != dataObjects.end() )
{
QgsLogger::debug( "unrefing " + fileName );
QgsDebugMsg( "unrefing " + fileName );
if ( --( iter->second.second ) == 0 )
{
QgsLogger::debug( "No one's using " + fileName + ", I'll erase it" );
QgsDebugMsg( "No one's using " + fileName + ", I'll erase it" );
delete iter->second.first;
dataObjects.erase( iter );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/gpx/qgsgpxprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ bool QgsGPXProvider::nextFeature( QgsFeature& feature )
const QgsTrack* trk;
trk = &( *mTrkIter );

QgsLogger::debug( "GPX feature track segments: ", trk->segments.size(), __FILE__, __FUNCTION__, __LINE__ );
QgsDebugMsg( QString("GPX feature track segments: %1").arg( trk->segments.size() ) );
if ( trk->segments.size() == 0 )
continue;

Expand Down
5 changes: 2 additions & 3 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ QString createFilters( QString type )
{
// NOP, we don't know anything about the current driver
// with regards to a proper file filter string
QgsLogger::debug( "fileVectorFilters, unknown driver: " + driverName );
QgsDebugMsg( "fileVectorFilters, unknown driver: " + driverName );
}

} // each loaded GDAL driver
Expand Down Expand Up @@ -1534,8 +1534,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
break;
default:
{
QgsLogger::debug( "Unknown vector type of: ", ( int )( vectortype ), 1,
__FILE__, __FUNCTION__, __LINE__ );
QgsDebugMsg( QString("Unknown vector type of: %1").arg( ( int )( vectortype ) ) );
return false;
break;
}
Expand Down

0 comments on commit 7a0a3fb

Please sign in to comment.