[path] litte kDebug extension

Thiago Macieira thiago at kde.org
Fri Sep 14 12:15:00 BST 2007


On Friday 14 September 2007 10:21:13 Thomas Zander wrote:
> On Friday 14 September 2007 08:51:52 Boudewijn Rempt wrote:
> > > In all but the largest of applications, area 0 should suffice.
> > >
> > > If you don't want those areas to show up during your debugging, don't
> > > debug that application :-)
> >
> > I don't think Krita is particularly large, about 100 kloc. But I still
> > want to be able to disable the redisplay debug lines and enable the
> > filter debug lines. And I guess that it's the same with other
> > applications of that size.
>
> Agreed,
>
> also note that _printing_ debug still is an overhead and especially in an
> app like Krita where lots of code and libs are used while doing normal
> painting you want to be able to disable debugging of, for example, the
> image library. Since you are debugging a krita-plugin with debug area 0.

It makes no difference in overhead if the debugging statement is printed or 
not. It's still evaluated, processed, stored in a QString and then QDebug 
will call write() on a QIODevice that will discard the contents.

There's no way around it without modifying QDebug -- which I might do for Qt 
4.4.

The only way to avoid the overhead is to disable debugging completely in the 
application. And then it doesn't matter whether the area was 0 or not. 
kDebug() will evaluate to:

if (false); else kDebugDevNull()

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070914/f91f1439/attachment.sig>


More information about the kde-core-devel mailing list