Skip to content

Commit db1f36d

Browse files
author
jef
committed
use QgsDebugMsg
git-svn-id: http://svn.osgeo.org/qgis/trunk@12427 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 726ae1c commit db1f36d

File tree

6 files changed

+22
-30
lines changed

6 files changed

+22
-30
lines changed

src/app/qgsnewconnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void QgsNewConnection::testConnection()
139139
QgsDataSourceURI uri;
140140
uri.setConnection( txtHost->text(), txtPort->text(), txtDatabase->text(), txtUsername->text(), txtPassword->text(), ( QgsDataSourceURI::SSLmode ) cbxSSLmode->currentIndex() );
141141

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

144144
PGconn *pd = PQconnectdb( uri.connectionInfo().toLocal8Bit().data() );
145145
if ( PQstatus( pd ) == CONNECTION_OK )

src/core/qgsmaplayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ bool QgsMapLayer::isValid()
359359

360360
void QgsMapLayer::invalidTransformInput()
361361
{
362-
QgsLogger::warning( "QgsMapLayer::invalidTransformInput() called" );
362+
QgsDebugMsg( "called" );
363363
// TODO: emit a signal - it will be used to update legend
364364
}
365365

src/core/qgsmaprenderer.cpp

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,10 @@ void QgsMapRenderer::adjustExtentToSize()
180180
dymax = mExtent.yMaximum() + whitespace;
181181
}
182182

183-
#ifdef QGISDEBUG
184-
QString myMessage = "+-------------------MapRenderer--------------------------------+\n";
185-
myMessage += QString( "Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX ).arg( mapUnitsPerPixelY );
186-
myMessage += QString( "Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth ).arg( myHeight );
187-
myMessage += QString( "Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width() ).arg( mExtent.height() );
188-
myMessage += mExtent.toString();
189-
std::cout << myMessage.toLocal8Bit().constData() << std::endl; // OK
190-
191-
#endif
192-
183+
QgsDebugMsg( QString("Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX ).arg( mapUnitsPerPixelY ) );
184+
QgsDebugMsg( QString("Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth ).arg( myHeight ) );
185+
QgsDebugMsg( QString("Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width() ).arg( mExtent.height() ) );
186+
QgsDebugMsg( mExtent.toString() );
193187

194188
// update extent
195189
mExtent.setXMinimum( dxmin );
@@ -200,9 +194,7 @@ void QgsMapRenderer::adjustExtentToSize()
200194
// update the scale
201195
updateScale();
202196

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

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

222214
if ( mExtent.isEmpty() )
223215
{
224-
QgsLogger::debug( "empty extent... not rendering" );
216+
QgsDebugMsg( "empty extent... not rendering" );
225217
return;
226218
}
227219

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

344336
if ( !ml )
345337
{
346-
QgsLogger::warning( "Layer not found in registry!" );
338+
QgsDebugMsg( "Layer not found in registry!" );
347339
continue;
348340
}
349341

@@ -472,8 +464,9 @@ void QgsMapRenderer::render( QPainter* painter )
472464
}
473465
else
474466
{
475-
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
467+
QgsDebugMsg( "Layer rendered without issues" );
476468
}
469+
477470
if ( split )
478471
{
479472
mRenderContext.setExtent( r2 );
@@ -708,7 +701,7 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent
708701
catch ( QgsCsException &cse )
709702
{
710703
Q_UNUSED( cse );
711-
QgsLogger::warning( "Transform error caught in " + QString( __FILE__ ) + ", line " + QString::number( __LINE__ ) );
704+
QgsDebugMsg( "Transform error caught" );
712705
extent = QgsRectangle( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
713706
r2 = QgsRectangle( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
714707
}
@@ -752,7 +745,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
752745
catch ( QgsCsException &cse )
753746
{
754747
Q_UNUSED( cse );
755-
QgsDebugMsg( QString( "Transform error caught:%s" ).arg( cse.what() ) );
748+
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
756749
}
757750
}
758751
else
@@ -773,7 +766,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
773766
}
774767
catch ( QgsCsException &cse )
775768
{
776-
QgsDebugMsg( QString( "Transform error caught: %s" ).arg( cse.what() ) );
769+
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
777770
throw cse; //let client classes know there was a transformation error
778771
}
779772
}
@@ -820,7 +813,7 @@ void QgsMapRenderer::updateFullExtent()
820813
QgsMapLayer * lyr = registry->mapLayer( *it );
821814
if ( lyr == NULL )
822815
{
823-
QgsLogger::warning( "WARNING: layer '" + ( *it ) + "' not found in map layer registry!" );
816+
QgsDebugMsg( QString("WARNING: layer '%1' not found in map layer registry!").arg( *it ) );
824817
}
825818
else
826819
{

src/providers/gpx/gpsdata.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ QgsGPSData* QgsGPSData::getData( const QString& fileName )
376376
return 0;
377377
}
378378
QgsGPSData* data = new QgsGPSData;
379-
QgsLogger::debug( "Loading file " + fileName );
379+
QgsDebugMsg( "Loading file " + fileName );
380380
QgsGPXHandler handler( *data );
381381
bool failed = false;
382382

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

417417
// return a pointer and increase the reference count for that file name
418418
DataMap::iterator iter = dataObjects.find( fileName );
@@ -429,10 +429,10 @@ void QgsGPSData::releaseData( const QString& fileName )
429429
DataMap::iterator iter = dataObjects.find( fileName );
430430
if ( iter != dataObjects.end() )
431431
{
432-
QgsLogger::debug( "unrefing " + fileName );
432+
QgsDebugMsg( "unrefing " + fileName );
433433
if ( --( iter->second.second ) == 0 )
434434
{
435-
QgsLogger::debug( "No one's using " + fileName + ", I'll erase it" );
435+
QgsDebugMsg( "No one's using " + fileName + ", I'll erase it" );
436436
delete iter->second.first;
437437
dataObjects.erase( iter );
438438
}

src/providers/gpx/qgsgpxprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ bool QgsGPXProvider::nextFeature( QgsFeature& feature )
301301
const QgsTrack* trk;
302302
trk = &( *mTrkIter );
303303

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

src/providers/ogr/qgsogrprovider.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ QString createFilters( QString type )
13251325
{
13261326
// NOP, we don't know anything about the current driver
13271327
// with regards to a proper file filter string
1328-
QgsLogger::debug( "fileVectorFilters, unknown driver: " + driverName );
1328+
QgsDebugMsg( "fileVectorFilters, unknown driver: " + driverName );
13291329
}
13301330

13311331
} // each loaded GDAL driver
@@ -1534,8 +1534,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
15341534
break;
15351535
default:
15361536
{
1537-
QgsLogger::debug( "Unknown vector type of: ", ( int )( vectortype ), 1,
1538-
__FILE__, __FUNCTION__, __LINE__ );
1537+
QgsDebugMsg( QString("Unknown vector type of: %1").arg( ( int )( vectortype ) ) );
15391538
return false;
15401539
break;
15411540
}

0 commit comments

Comments
 (0)