[Development] Proposal: Changing the default output of qDebug and friends
kai.koehne at nokia.com
kai.koehne at nokia.com
Thu Mar 29 15:17:14 CEST 2012
> -----Original Message-----
> From: Ramsay Lincoln (Nokia-MP/Brisbane)
> Sent: Thursday, March 29, 2012 9:20 AM
> To: Koehne Kai (Nokia-MP/Berlin)
> Cc: development at qt-project.org
> Subject: Re: [Development] Proposal: Changing the default output of
> qDebug and friends
>
> 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...
For my original proposal I took inspiration from the KDE debug output. Anyhow, I agree that the application name / pid just adds noise if you launched your app yourself from the shell.
So, about "[%{type}] %{function} - %{message}" then?
Any other opinions? Olivier, do you think that's sensible?
Regards
Kai
> --
> Lincoln Ramsay - Senior Software Engineer Qt Development Frameworks,
> Nokia - http://qt.nokia.com/
More information about the Development
mailing list