kDebug() output not possible to disable

David Faure faure at kde.org
Mon May 25 08:57:42 BST 2009


On Thursday 22 May 2008, Andreas Pakulat wrote:
> On 22.05.08 16:55:40, Thiago Macieira wrote:
> > On Thursday 22 May 2008 14:39:53 Andreas Pakulat wrote:
> > > Hi,
> > >
> > > I just noticed that debug output printed via a simple
> > >
> > > kDebug() << "foobar";
> > >
> > > cannot be turned off via kdebugdialog. I have all area's disabled here,
> > > but I still see the output of such calls.
> > >
> > > Anybody aware of any changes related to that? Should I file a bugreport?
> > 
> > Those can't be disabled, short of disabling debugging when building (i.e., 
> > release mode).
> 
> Why?
> 
> > They are meant for applications only. That means any use of kDebug() with 
> > debug area 0 in a library is a bug.
> 
> Then why is there an entry in kdebugdialog to disable them? It should be
> possible to either disable the area output or the entry from the dialog
> should go.

Yep, was a bug. Here's the fix, a year later :-)

--- io/kdebug.cpp       (revision 971495)                              
+++ io/kdebug.cpp       (working copy)                                 
@@ -239,7 +239,7 @@                                                    
         cache.clear();                                                
                                                                       
         Area &areaData = cache[0];                                    
-        areaData.clear(QtOutput);
+        areaData.clear();

         //AB: this is necessary here, otherwise all output with area 0 won't be
         //prefixed with anything, unless something with area != 0 is called before

-- 
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list