[Development] QLog ( Work on qDebug and friends)

Lincoln Ramsay lincoln.ramsay at nokia.com
Wed Feb 15 02:05:37 CET 2012


On 02/15/2012 01:47 AM, ext BRM wrote:
> I'd much rather see a Category object being pushed via operator<<()
> instead so that it can be detected and allow things like:
>
> // assume QMessageLoggerCategory(category) is a class
> qDebug() << QMessageLoggerCategory("category1")<<  "message for
> category1"<< QMessageLoggerCategory("category2")<<  "message for
> category2";

This fails the "do nothing quickly" test so the cost of leaving such 
statements in shipping code is high, even when the categories are disabled.

This works fine though.

qLog(category1) << "message for category1";
qLog(category2) << "message for category2";


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



More information about the Development mailing list