> From: Lincoln Ramsay <[email protected]>
> To: [email protected]
> Cc: 
> Sent: Tuesday, February 14, 2012 8:05 PM
> Subject: Re: [Development] QLog ( Work on qDebug and friends)
> 
> 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";

No more than the Macro.

Yes, it would need to read all the strings; but then it could just read them 
instead. The macro fails in the same respect.

It can also do the same test - and output an empty (or special) object if the 
category is not enabled, or a complete object if it is not..
And the first qDebug() can be still managed by the macro to completely disable 
everything just the same.

Ben

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to