[Development] QLog ( Work on qDebug and friends)

Lincoln Ramsay lincoln.ramsay at nokia.com
Wed Feb 15 02:10:35 CET 2012

On 02/14/2012 08:22 PM, Koehne Kai (Nokia-MP/Berlin) wrote:
> Here's another idea:
> // in qlogging.h
> void qMessageLogEnabled(const char *area)
> #define QMessageArea(area) if (qMessageLogEnabled(area)) QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, area)
> Usage would be e.g.
> QMessageArea("MyArea").debug()<<  expensiveFunc();
> QMessageArea("MyArea").warning("%s", expensiveFunc());

Supporting both debug and warning statements tied to a category isn't 
useful. Warnings have always been unconditional and will remain so.

Removing that from your example gives almost the same syntax as qLog but 
with a different name and I think I've covered that already :)

Lincoln Ramsay - Senior Software Engineer
Qt Development Frameworks, Nokia - http://qt.nokia.com/

More information about the Development mailing list