[Development] QLog ( Work on qDebug and friends)

wolfgang.beck at nokia.com wolfgang.beck at nokia.com
Tue Feb 21 08:07:35 CET 2012


One of the requirements was to activate the category log without recompiling the code.
Of course you can design QLog in that way that it can overwrite the category flags out from the QLog config file but then we have two different ways to activate or deactivate categories and each QLog enable check (remember the macros) and category check becomes bigger and maybe more complex.
If QLog works only with the config file you can be sure after you are done with developing QLog is disable as long you don't add the config file in your package.
How hard can it be to create a simple config file and change the category values?

B.R.
 WB



-----Original Message-----
From: development-bounces+wolfgang.beck=nokia.com at qt-project.org [mailto:development-bounces+wolfgang.beck=nokia.com at qt-project.org] On Behalf Of ext BRM
Sent: Tuesday, February 21, 2012 12:14 AM
To: development at qt-project.org
Subject: Re: [Development] QLog ( Work on qDebug and friends)

----- Original Message -----

> From: Thiago Macieira <thiago.macieira at intel.com> On segunda-feira, 20 
> de fevereiro de 2012 12.42.49, David Faure wrote:
>>  > Do you imagine something in the qLog config file? An environment  
>> > variable? A C++ API?
>> 
>>  I think "something in the qLog config file" is the best option. 
> It allows
>>  to  provide a GUI tool that toggles the configuration, for users.
> 
> Remember that QtCore has no configuration file. We've removed all 
> traces of QSettings support so QSettings could be moved away.

How about have some method of the application that could load what to log or not log; a simple set of 2 functions, each takes a QStringList of the categories:

// positive enabling (negative disable)
static void QMessageLogger::enableLogCategories(QStringList categoryList); // positive disabling (negative enable) static void QMessageLogger::disableLogCategories(QStringList categoryList);

// to enable verification of the above
static bool QMessageLogger::isPositiveEnable();
static bool QMessageLogger::isPositiveDisable();

// return the current list of categories loaded for positive enabling/disabling static QStringList QMessageLogger::getCategories(); // return the build-time list of Qt categories static QStringList QMessageLogger::getQtCategories();

Only one method could be used at a time.

It would be up to the application developer which to use and how to load it.

By default, all Qt message categories would be positively disabled.

$0.02

Ben

_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list