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

Martin Dobias wonder.sk at gmail.com
Wed Mar 22 13:08:05 EST 2006


On 3/22/06, Mateusz Łoskot <mateusz at loskot.net> wrote:
> Radim Blazek wrote:
> > On 3/22/06, Mateusz Łoskot <mateusz at loskot.net> wrote:
> >
> >>But how the second macro should work?
> >>Do you expect that everytime and everywhere debug output API is used, it
> >>reads for QGIS_DEBUG_FILE and checks if it contains current file.
> >>If it does, then debug output is turned on for this file.
> >>Right?
> >>
> >>Basic example:
> >>
> >>GEOS_DEBUG_PRINT("this is my debug message")
> >>
> >>This macro is expanded to something like following operations:
> >>
> >>Now, when QGIS is executed, macro checks:
> >>- is there any QGIS_DEBUG_FILE deined?
> >>- if there is, check if it contains file with name of current
> >>   file; here __FILE__ can be used
> >>- if current file is there, print debug message, if not, just ignore it.
> >>
> >>Is this your idea?
> >
> >
> > Yes.
>
>
> Great and I like it :-)
>
> What is the current state of debug output?
> I mean what is the current strategy?
>
> Does everyone agree with Radim's idea?
> Should current technique be changed according to Radim's concept?

I like this approach very much. Sometimes it's really hard to track
debug messages I need it the flow of the other ones.

I also don't like that construct #ifdef QGISDEBUG ... #endif which can
be eliminated.

Moreover it would be good to have some constants or so, which will
indicate what kind of debug message is it - e.g. notice, warning,
error, fatal. Then, a call like

DEBUG_PRINT(NOTICE, "This is just a notice")

would produce e.g.:
NOTICE: This is just a notice.

So normal users will get only warning and errors... or should be
warning/error messages  handled in other way?

Martin

>
> 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