[Development] Proposal: Changing the default output of qDebug and friends
Lincoln Ramsay
lincoln.ramsay at nokia.com
Thu Mar 29 09:19:51 CEST 2012
On 03/29/2012 05:03 PM, Koehne Kai (Nokia-MP/Berlin) 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.
>
> 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.
My bad. I thought you were suggesting them in the default :)
> Anyhow: Is the current default of printing just the message really
> the optimal one?
Possibly not. I suspect though that turning on all the options by
default will prove frustrating for many use cases.
Lets define some shall we?
Running an app with warnings/debugs that does to the "system output". On
Linux, this is ~/.xsession-errors and here, app+pid would be useful. On
Windows this is the debug log... I can't remember if it includes app+pid
already or not. On Mac this is Console.app and this already includes
app+pid.
Running multiple apps with all output put into a single log file (say,
on an embedded system that doesn't use syslog) the app+pid would be useful.
Running an app from the command line, you don't need app+pid because
you're only looking at one app's output.
It seems to me that app+pid may not be so useful by default.
But I guess having the type (avoiding redundant warning/error), function
(avoiding Q_FUNC_INFO) and message should be ok as long as it doesn't
bloat message length too much...
--
Lincoln Ramsay - Senior Software Engineer
Qt Development Frameworks, Nokia - http://qt.nokia.com/
More information about the Development
mailing list