[Interest] Logging best practice.

Bo Thorsen bo at fioniasoftware.dk
Mon Dec 19 17:15:14 CET 2011


Den 19-12-2011 13:32, David Faure skrev:
> On Friday 09 December 2011 13:56:54 Bo Thorsen wrote:
>> Den 09-12-2011 10:31, kai.koehne at nokia.com skrev:
>>> Syntax could e.g. be:
>>>
>>> qLog(QWidget).location(__FILE__, __LINE__)<<   "Created"<<   name;
>>>
>>> (Maybe __FILE__ , __LINE__ can be automatically retrieved by yet another
>>> macro? Not sure ...).
>> You can only do that if qLog is a macro itself.
>>
>> Alternatively, it could be done with one of my long standing christmas
>> wishes: qBacktrace() :)
>
> Hi Bo!
>
> Here's your christmas gift, a little bit in advance :-)
>
> http://www.davidfaure.fr/kde/qbacktrace4

Hi David :)

I know about this one, and I have one using libunwind in my own code 
set. I also had one on Windows, but that was customer code.

My christmas wish is for a qBacktrace that's in Qt and supported on 
(almost?) all platforms.

Unfortunately it looks like it's impossible to do this on Symbian, so 
while that's a supported platform it's not possible to have this for all 
platforms.

David, if I do the backtrace code on Windows and push the patch to 
4.9/5.0, will you do the same for this code? Then we just need someone 
to add the code for Mac, and we're well on the way.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Interest mailing list