[Development] QLog ( Work on qDebug and friends)

wolfgang.beck at nokia.com wolfgang.beck at nokia.com
Wed Feb 22 01:29:35 CET 2012


> So how about adding another QtMsgType called QLogMsg, that qLog() uses? In contrast to qDebug/QtDebugMsg, qLog/QtLogMsg messages would not be processed by default, unless the configuration file (or an environment variable) says so ...

There is no need for this Kai.
The macro will not even create a QMessageLogger if the category is not enabled.
Have a look in the qMessageFormatString of the QLog patch how I detect if I need to add a category or not.

B.R.
 WB

-----Original Message-----
From: Koehne Kai (Nokia-MP/Berlin) 
Sent: Tuesday, February 21, 2012 8:02 PM
To: ext David Faure; Beck Wolfgang (Nokia-MP/Brisbane)
Cc: development at qt-project.org
Subject: RE: [Development] QLog ( Work on qDebug and friends)

> -----Original Message-----
> From: development-bounces+kai.koehne=nokia.com at qt-project.org
> [mailto:development-bounces+kai.koehne=nokia.com at qt-project.org] On 
> Behalf Of ext David Faure
> Sent: Tuesday, February 21, 2012 10:36 AM
> To: Beck Wolfgang (Nokia-MP/Brisbane)
> Cc: development at qt-project.org
> Subject: Re: [Development] QLog ( Work on qDebug and friends)
> 
> On Tuesday 21 February 2012 06:28:38 wolfgang.beck at nokia.com wrote:
> > I'm preferring having QLog active only if a config file is there.
> > It doesn't make sense to me at all having an environment variable 
> > that can activate QLog but not config file to activate the 
> > categories. As long there is no config file QLog is disable and uses 
> > less performance as possible but still having the feature that you 
> > can activate it without recompiling the code.
> 
> Why? IMHO things should go to stderr by default. So it makes perfect 
> sense to see the output, even if one didn't configure output files in a config file.

I agree with that: On the desktop it's quite handy to see also detailed output on stderr/the shell (which one can redirect to a file if needed). But I also think that qLog() messages shouldn't show up by default for normal users, that is, unless the category has been explicitly enabled.

So how about adding another QtMsgType called QLogMsg, that qLog() uses? In contrast to qDebug/QtDebugMsg, qLog/QtLogMsg messages would not be processed by default, unless the configuration file (or an environment variable) says so ...

Kai

> I guess this is a mobile platform vs desktop platform discussion. On a 
> mobile platform the logs are only useful if they go to a file, while 
> on the desktop the logs are useful also if they go to stderr, to get 
> them in a terminal or in the session log file.
> 
> 
> --
> David Faure | david.faure at kdab.com | KDE/Qt Senior Software Engineer 
> KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 
> 08 53, Sweden (HQ) +46-563-540090 KDAB - Qt Experts - 
> Platform-independent software solutions
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list