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

Tim Sutton tim at linfiniti.com
Wed Mar 22 06:33:01 EST 2006


+1

On 3/22/06, nhugent at hispeed.ch <nhugent at hispeed.ch> wrote:
> Dear qgissers,
>
> I'm making some tests with qgis as a cgi application. The problem i have is that the webserver expects the cgi output on standard out and expects the output to be finished when standard out is closed. In qgis, there are many prints to std::cout for debugging purposes. My suggestion is to not use std::cout for debug messages anymore, but rather the QgsDebug macro (which calls qDebug). Like this, it is possible to install a qt message handler, which allows to handle these messages in a very flexible way. E.g. i could make qgis being quiet for cgi. We could display only qCritical and qFatal messages to end users and not debug output. An additional benefit of the QgsDebug macro is that it automatically prints out the file name and line number.
>
> In order to create a 'hello cgi qgis' application, i already started to replace some debug messages with QgsDebug and commented out some std::cout messages where many of them appear (e.g. in QgsRasterLayer and QgsColorTable). I wanted to ask if it will be ok to commit these changes or if there are any objections.
>
> Greetings,
> Marco
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>


--
Tim Sutton

Visit http://qgis.org for a great Open Source GIS
Skype: timlinux
MSN: tim_bdworld at msn.com
Yahoo: tim_bdworld at yahoo.com
Jabber: timlinux
Irc: timlinux on #qgis at freenode.net



More information about the Qgis-developer mailing list