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

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

One other idea I could throw into the pot is to have a logger class. We
could then set it up to write to console, to file or even in the future
to some part of the gui. The latter could help when we have non
technical users and windows users who experience problems - we can just
ask us to send output from the logger window or whathaveyou. Log
requests could be static methods or we could use qt signals and slots
and connect the logger to objects being logged when they are
instantiated. Example invocation mechanisms:

emit logMessage("foo",QgsLogger::Critical);
emit logMessage("foo",QgsLogger::Informational);

or

QgsLogger::logMessage("foo",QgsLogger::Critical);
QgsLogger::logMessage("foo",QgsLogger::Informational);

Just another thought anyway...

Regards

Tim

Martin Dobias wrote:
> On 3/22/06, Mateusz ?oskot <mateusz at loskot.net> wrote:
>> Martin Dobias wrote:
>>> 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")
>> I'd name all QGIS related macros starting from QGIS_,
>> e.g. QGIS_DEBUG_PRINT or QGIS_DEBUG_MSG
>>
>> There were problems with GEOS on Windows, because it used macro named as
>> DEBUG, which is defined and used by VC++ compiler.
>> So, it had to be changed to GEOS_DEBUG.
>>
>>> would produce e.g.:
>>> NOTICE: This is just a notice.
>> Do you mean this additional argument should control
>> what is placed in front of the message?
>> Examples:
>>
>> ERROR: This is an error
>> or for better readability:
>>
>> #
>> # ERROR: This is an error
>> #
>>
>> WARNING: This is a warning
>> NOTICE: This is a note
>>
>> ?
> 
> I meant it could help users (and developers) to find out what does the
> message actually mean when they don't know exactly what does it mean
> and whether they should report it. Btw. good idea that errors could be
> printed with such emphasis.
> 
> 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
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.qgis.org
>> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer


- --
Tim Sutton (tim at linfiniti.com)

Visit http://qgis.org for a great open source GIS application
Skype : timlinux
Jabber : timlinux at jabber.org
MSN : tim_bdworld at msn.com
ICQ : 245485851
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEIcz9WvXTJUo0BDoRAgMzAKCEGSKrG4K50ILnXdSP1IF9gp5AogCff86i
yV1wm889Ymk1O9GXGVtMTro=
=/sFi
-----END PGP SIGNATURE-----



More information about the Qgis-developer mailing list