From kde-core-devel Tue Dec 21 17:52:41 1999 From: Mirko Sucker Date: Tue, 21 Dec 1999 17:52:41 +0000 To: kde-core-devel Subject: Re: RFC: Strategy for integrating the Nana debugging library X-MARC-Message: https://marc.info/?l=kde-core-devel&m=94580224627317 "Dirk A. Mueller" wrote: > Why do we need debug areas when nana remembers file and line number of where > the debug statement is? This is simpler and still more informative imho. > For kdebug you have to "allocate" a area number and use (read: remember and > type) that wherever I just want to have a short debug output. Well, it is up to you to decide what implementation you use. If there are some people (there are quite a number of them) that like areas, this 5kBytes of code should remain. > the debug output is right now removed because it slows things down, > especially when kdebug is used. > > nana seems to be nicer because it only slows down when the code is compiled > with debug information and it actually makes sense to search for bugs. from kdebug.h: #ifdef kdebug #undef kdebug #endif #ifdef NDEBUG #define kdebug kdebug_null #endif ... from kdebug.cpp: void kdebug_null( ushort /*nLevel*/, ushort /*nArea*/, const char* /*pFormat*/, ... ) { return; } When compiling with NDEBUG, every compiler should not even create the call to kdebug_null. Greetings, --Mirko. -- Denn der Mensch liebt und ehrt den Menschen, solange er ihn nicht zu beurteilen vermag, und die Sehnsucht ist ein Erzeugnis mangelhafter Erkenntnis. (Thomas Mann)