[Development] QLog ( Work on qDebug and friends)
bm_witness at yahoo.com
Mon Feb 20 15:13:33 CET 2012
----- 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.
More information about the Development