Macro for QgsLogger?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro for QgsLogger?

Martin Dobias
Hi,

I just have a question - isn't it possible to use a macro for
QgsLogger::debug call which would automatically add __FILE__,
__FUNCTION__ and __LINE__ parameters? It would save some typing, e.g.
instead of using

QgsLogger::debug("c3", (int) mDiscrete[i].c3, 2, __FILE__,
__FUNCTION__,  __LINE__);

use something like

QgsLogger_debug("c3", (int) mDiscrete[i].c3, 2);



And by the way, could be QgsLogger output a bit less verbose?

This is how does it look like now:

Debug: File: qgsogrprovider.cpp, Function: getNextFeature, Line: 532,
Message: Testing geometry using mbr


I would prefer something similar to output from gcc:

qgsogrprovider.cpp:532: (getNewFeature) Testing geometry using mbr



Bye,
Martin
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Macro for QgsLogger?

Hugentobler  Marco
Hi Martin,

There is already a macro QgsDebugMsg(str) in the logger class doing this, but
not for variable/int or variable/double pairs. I could add QgsDebugMsg(str,
val), since QString::number is for int and doubles (but perhaps with ugly
formating for doubles).
Changing the output is no problem.

cheers,
Marco



Am Mittwoch 05 April 2006 11:33 schrieb Martin Dobias:

> Hi,
>
> I just have a question - isn't it possible to use a macro for
> QgsLogger::debug call which would automatically add __FILE__,
> __FUNCTION__ and __LINE__ parameters? It would save some typing, e.g.
> instead of using
>
> QgsLogger::debug("c3", (int) mDiscrete[i].c3, 2, __FILE__,
> __FUNCTION__,  __LINE__);
>
> use something like
>
> QgsLogger_debug("c3", (int) mDiscrete[i].c3, 2);
>
>
>
> And by the way, could be QgsLogger output a bit less verbose?
>
> This is how does it look like now:
>
> Debug: File: qgsogrprovider.cpp, Function: getNextFeature, Line: 532,
> Message: Testing geometry using mbr
>
>
> I would prefer something similar to output from gcc:
>
> qgsogrprovider.cpp:532: (getNewFeature) Testing geometry using mbr
>
>
>
> Bye,
> Martin
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer