> -----Original Message-----
> From: Konstantin Ritt [mailto:[email protected]]
> Sent: Wednesday, January 08, 2014 10:39 AM
> To: Koehne Kai
> Cc: Giuseppe D'Angelo; [email protected]
> Subject: Re: [Development] Let's get rid of qDebug/qWarning/qCritical!
> 
> I have a controversial proposition: make qDebug/qWarning/qCritical support
> logging category and deprecate qCDebug/qCWarning/qCCritical [1].
> 
> [1]  https://codereview.qt-project.org/#change,74889

Originally I wasn't too happy about the qCX names, either. Anyhow, they were 
introduced to satisfy two demands:

a) we want to keep source compatibility for existing uses of qDebug()

a) the runtime costs for logging to a category/level that's not enabled should 
be minimal

I guess it's clear we can't break a). To satisfy b), qCDebug expands to a 
pre-check that skips any evaluation of args etc.  If we want to keep qDebug 
we'd have to accept that arguments are evaluated (we could try to avoid too 
expensive operations though by putting logic in operator<<()'s .

Personally, I'm happy to trade the slight awkwardness of the qCDebug name for 
the benefit of not having to worry too much about potential overhead.

What you and André also seem to suggest is to keep the printf style . That's 
actually trivial to add to qCDebug and friends if we require support for 
variadic macros ... qcompilerdetection.h seems to indicate that variadic macros 
are supported in GCC>=4.3, MSVC>=2005 and Intel>12. IMO that sounds like we 
could make it a hard requirement?

Regards

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

Reply via email to