[Development] QLog ( Work on qDebug and friends)
kai.koehne at nokia.com
kai.koehne at nokia.com
Tue Feb 21 12:32:09 CET 2012
> -----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 Thiago Macieira
> Sent: Tuesday, February 21, 2012 11:13 AM
> To: development at qt-project.org
> Subject: Re: [Development] QLog ( Work on qDebug and friends)
> On terça-feira, 21 de fevereiro de 2012 10.02.23, kai.koehne at nokia.com
> > So how about adding another QtMsgType called QLogMsg, that qLog()
> > uses? In contrast to qDebug/QtDebugMsg, qLog/QtLogMsg messages
> > not be processed by default, unless the configuration file (or an
> > environment
> > variable) says so ...
> That's almost a necessity. An informative message is not debugging.
> >From sys/syslog.h:
> #define LOG_EMERG 0 /* system is unusable */
> #define LOG_ALERT 1 /* action must be taken immediately */
> #define LOG_CRIT 2 /* critical conditions */
> #define LOG_ERR 3 /* error conditions */
> #define LOG_WARNING 4 /* warning conditions */
> #define LOG_NOTICE 5 /* normal but significant condition */
> #define LOG_INFO 6 /* informational */
> #define LOG_DEBUG 7 /* debug-level messages */
> We don't have EMERG and ALERT because Qt applications (often) aren't
> system applications and can't cause those conditions. And we don't have
> NOTICE or INFO because our message output was designed only for
> developer usage (from developers to other developers).
Actually I'd also like to get a qInfo/QtInfoMsg level at one point,
in QML right now all result in a qDebug() call.
The other use case I ran into in the past is this message:
"Qml debugging is enabled. Only use this in a safe environment!"
Which is printed on startup for applications configured with Qt+=declarative_debug . Right now it's a qWarning(), but I got numerous complains that it is making QT_FATAL_WARNINGS useless ...
Anyhow, this is something we probably could still do in 5.x.
> That also reminds me: some systems would benefit from having our message
> output go to syslog. MeeGo had a patch that I wrote a long time ago that
> sent all messages to syslog.
> Thiago Macieira - thiago.macieira (AT) intel.com
> Software Architect - Intel Open Source Technology Center
> Intel Sweden AB - Registration Number: 556189-6027
> Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
More information about the Development