[Development] [Request] Add Info to QDebug

Kurt Pattyn pattyn.kurt at gmail.com
Mon Dec 23 21:39:01 CET 2013

On 23 Dec 2013, at 17:38, development-request at qt-project.org wrote:

> From: Andreas Aardal Hanssen <andreas at hanssen.name>
> Subject: Re: [Development] [Request] Add Info to QDebug
> Date: 23 Dec 2013 15:17:06 GMT+1
> To: development at qt-project.org
> FTR, I’m completely -1 for touching QDebug and friends, and +1 for adding a proper logging framework. QDebug, qWarning, qCritical and qFatal are for programmers, not administrators who want app log output for system maintenance.
I think that QDebug can be a sound foundation for a ‘proper’ logging framework.

> In our app environment, we have (as many else!) added our own Log<Info>() << “bar”, which formats the log output according to our system-wide standard. That makes the logs parseable to all our internal tools. We also override Qt’s debug handlers to ensure that any use of qDebug, warning, critical or fatal ends up properly formatted. I.e. the the debug handler uses our Log thing.

So, programmers log messages do finally end up in the logs. By using qSetMessagePattern it is possible to format the log output as well. By only using q(C)Debug(), q(C)Info(), … there is a single API to do logging.
By implementing a proper logging backend, Qt could have plugins to log to (r)syslog(-ng), Windows Event Log, slog2, aso, and then there would be an almost perfect fit for qDebug(), qInfo(), ...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131223/44cf6253/attachment.html>

More information about the Development mailing list