[Development] Proposal: Changing the default output of qDebug and friends

Olivier Goffart olivier at woboq.com
Thu Mar 29 01:54:47 CEST 2012


On Thursday 29 March 2012 09:43:53 Lincoln Ramsay wrote:
> On 03/29/2012 09:41 AM, ext Lincoln Ramsay wrote:
> > Why can't Creator just set the QT_MESSAGE_PATTERN environment variable
> > then and leave the default alone? Creator would not need to show the
> > filename and line number, just use them for when you click on the
> > warnings.

I think I agree with that. Creator can put whatever is needed for better 
experience. We don't need yo change the default.

> And related to this...
> 
> If we're going to have warnings that result in click-to-locate then we
> really need to find a way of doing perl-style carp (ie. warning from the
> caller's context).
> 
> I think that both Windows and Glibc have a facility that may allow this
> to be done but getting something truly cross-platform may not be possible.

> The QList.at() assertion has always struck me as totally useless because
> unless you've got a debugger attached you aren't told (and thus cannot
> find out) _where_ the code that triggered the assertion is. The ability
> to warn from the caller's perspective would make this assertion so much
> more useful.

That would be possible with runtime backtrace (#include <execinfo.h> 
backtrace(), on Linux)
So one could add some tokens in QT_MESSAGE_PATTERN to get the backtrace.
The problem is that runtime backtrace is often not really accurate.




More information about the Development mailing list