[Development] Work on qDebug and friends

kai.koehne at nokia.com kai.koehne at nokia.com
Tue Jan 24 13:39:00 CET 2012


> -----Original Message-----
> From: ext Diego Iastrubni [mailto:diegoiast at gmail.com]
> Sent: Tuesday, January 24, 2012 1:18 PM
> To: Koehne Kai (Nokia-MP/Berlin)
> Cc: development at qt-project.org
> Subject: Re: [Development] Work on qDebug and friends
> 
> So, if I want to have also time/date on my logs, should I install a new message
> handler?

Well, I plan to work on a simple environment switch which will enable the default logger to show the file, line, and the log level. My idea is that an IDE e.g. Qt Creator sets this environment variable, and voila, you can suddenly click on your log messages :)

Anyhow, there's a lot of things people might want to log in addition ( date, time, PID, QThread id ...). Some might also want to log to a file, or a database. Finally, the exact configuration might be compiled in, decided at load time (e.g. via an environment variable), or even at run time (e.g. http://codereview.qt-project.org/#change,13226 proposes to watch a file for possible configuration changes) ... 

So, instead of trying to add all of this over time to QtCore, I think we should rather go for a separate Qt Logging Addon that contains all of this. What we've to ensure right now is that the key enablers are there in Qt Core (see also the debug areas thread). Time and date can be trivially computed in any handler later on.

Just my 2 cents

Kai



More information about the Development mailing list