Hereby I start a new series of articles called "Insight Rewrite" which will give some details about this work or will work. Today's topic is: debugging.
Debugging support is essential as with unit testing we can only verify that a single function does what it's supposed to but not really/completely whether they're also used the right way.
Debugging will be available, as before, via the -d command line switch for all tools as well as via the $debug_level option. The reason behind the config option is that now users can freely turn debugging on and off during runtime as well as only change the verbosity level.
Before there were only a few debug files kept which is a "feature" removed in the rewrite. Now debug files will remain until they're deleted by users. Also, the naming is different: files will be named as: ~/.[scope].[pid].[id].log. These fields have the following meanings: "[scope]" is either "libmuttng" or one of "muttng-conf", "muttng-sync", etc (yes, debugging is done to different files for the libmuttng library and the actual application). "[pid]" is the current process' ID number. As debugging may be turned on and off during runtime, the "[id]" field starts off with "1" and will be subsequently increased everytime debugging is turned on again.
New is also the fact that each of the debug levels from 1 to 5 has it's own meaning, i.e. we don't choose a message's debug level by our current mood any longer. For example, level 1 is for all module registration and de-registration, level 2 for parsing, 3 for signals and events, etc.
As before, each line will contain the caller besides the message. New is that lines are space-indented to more quickly find things as debug files may grow quite large.
As some may have wondered why we organized the inheritance for libmuttng as well as applications the way we did: the debugging support is implemented in libmuttng and publicy visible (and thus useable) by applications so that the base classes LibMuttng and Muttng for both layers contain such a debug object. As a consequence, all classes have debug support. The level change is connected via the configuration manager and a signal to achieve separation.
As today and yesterday I ported a number of core/ functions required by the configuration parser, and finally added a first one simply printing each line read to the debug file, brave users can already get, compile and run the muttng-conf binary and see the files created in $HOME.
Next up on my todo list are all the unit tests still missing for these functions added so it depends on how much spare time I have whether we'll have a configuration parser to finish the year with.
(Btw, we developers will meet at the Chaos Communication Congress in Berlin at the end of the year and applied for its hackcenter so maybe we can meet users and/or write the parser.)