[Development] [Request] Add Info to QDebug

Andreas Aardal Hanssen andreas at hanssen.name
Tue Dec 24 01:38:07 CET 2013

On 23 Dec 2013, at 21:39, Kurt Pattyn <pattyn.kurt at gmail.com> wrote:
> 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.

That’s as silly as saying the same for printf, or cout. Sorry but I really disagree with you. In Java you also don’t see system.out.println used in any of the major log frameworks there.

>> 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.

We have to do that, otherwise they end up as console output, which isn’t seen anywhere. And no, qSetMessagePattern does nothing to solve our problem. This approach solves the problem the right way - redirecting programmer noise into a proper logging framework.

> 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(), …

Gah, rather I’d see activity on the project referred to by Thiago. qDebug isn’t a logging framework, it’s just what you use to print debug info to the console.

That’s pretty much my input to this thread..

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

More information about the Development mailing list