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

nhugent at hispeed.ch nhugent at hispeed.ch
Wed Mar 22 06:20:10 EST 2006


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



More information about the Qgis-developer mailing list