[Qgis-developer] prints to std::cout in qgis

Radim Blazek radim.blazek at gmail.com
Wed Mar 22 11:23:03 EST 2006


On 3/22/06, Mateusz Łoskot <mateusz at loskot.net> wrote:
> nhugent at hispeed.ch wrote:
> > My suggestion is to not use std::cout for debug messages anymore, but
> >  rather the QgsDebug macro (which calls qDebug).
>
> I agree with Marco.
> I'd also suggest to provide a macro that can be used to control debug
> messages per file (pair of .h/.cpp files).
> The idea is to turn all debug messages off and leave turned on
> only debug messages on for one particular file.
> This will help much to filter/track only objects/operations we are
> interested in when working on single feature/file.
> Now, QGIS debug mechanism outputs huge amount of messages and many of
> them are useless in many cases, so they should be filtered when not needed.
> This approach is used in GEOS and it works well.
>
> There is a macro GEOS_DEBUG that is turned off by default.
> But if someone want to debug/test e.g. Envelope class, then he has to
> put one line into Envelope.cpp file:
>
> #define GEOS_DEBUG 1
>
> This solution could be improved to turn on/off all debug messages
> globally or turn them on/off for particular file using local macro (like
> the GEOS_DEBUG).

That means that you have to recompile always when you need
a debug message and that is clumsy.
I would prefere to control debug with enviroment variables.
It can include also file specification.
E.g.
export QGIS_DEBUG=5
export QGIS_DEBUG_FILE=Envelope.cpp

Radim


> Cheers
> --
> Mateusz Łoskot
> http://mateusz.loskot.net
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>


More information about the Qgis-developer mailing list