[Development] Work on qDebug and friends - debug areas

wolfgang.beck at nokia.com wolfgang.beck at nokia.com
Fri Jan 27 02:38:34 CET 2012


I think QLog from QTopia was very good.
You define your category in your project and QLog will define a static bool for each category e.g.

# define QLOG_ENABLE(dbgcat) \
    class dbgcat##_QLog : public QLogBase { \
    public: \
                static inline bool enabled() { return 1; }\
    };

A log entry was done by:

# define qLog(dbgcat) if(!dbgcat##_QLog::enabled()); else dbgcat##_QLog::log(#dbgcat)

Misspelling can't be happening because you will get an compiler error.
No string compare are necessary because it uses the static category bool.
I think this is bloody fast and using this idea  + adding a config file to enable or disable Categories will be a good log system or not?
(http://codereview.qt-project.org/13226)

--
Wolfgang

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


More information about the Development mailing list