> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Ramsay Lincoln (Nokia-MP/Brisbane)
> Sent: Thursday, March 29, 2012 1:42 AM
> To: [email protected]
> Subject: Re: [Development] Proposal: Changing the default output of
> qDebug and friends
>
> On 03/29/2012 12:39 AM, ext [email protected] wrote:
> > PS: From an IDE perspective including the file + line would help so
> > that you could just 'jump' to the source of a warning by clicking on
> > it. However, the file string can get quite long (think about shadow
> > builds) ...
Hi Lincoln,
> 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.
You're right, that's actually what I intend do for apps started from within Qt
Creator, and which is why I don't suggest including %{file}, %{line} in the
default pattern.
Anyhow: Is the current default of printing just the message really the optimal
one ? It leads to anti-patterns like
qDebug() << Q_FUNC_INFO << xxx;
// note that QT_MESSAGE_PATTERN="%{function} %{message}" produces much nicer
output
or
qWarning() << "Warning: xxx";
It also leads to a misuse of using qDebug for 'normal' application output, e.g.
// misuse of qDebug, will look ugly with QT_MESSAGE_PATTERN, might break
with future category logging
if (app.arguments().size() != 2)
qDebug() << "myapp <file>";
So IMO a bit more verbose output wouldn't harm, and actually help in keeping
the code clean.
Regards
Kai
> --
> Lincoln Ramsay - Senior Software Engineer Qt Development Frameworks,
> Nokia - http://qt.nokia.com/
> _______________________________________________
> Development mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/development
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development