Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[From Arnaud Giersch] Fix the following problems in xbt/log:
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Jul 2010 14:06:49 +0000 (14:06 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Jul 2010 14:06:49 +0000 (14:06 +0000)
commit963548d1d1605cea97d1923d069a56e8b5df1daa
tree5e764fe3c796dd5c3a9d9861494d87f757231a08
parent97959f5438b9283f9436747b01008a27fe3ce4e6
[From Arnaud Giersch] Fix the following problems in xbt/log:
* segmentation fault in _xbt_log_cat_init() when running with
  "--log=log.thres:verbose"
* messages in _xbt_log_cat_apply_set() are not sent to "log" category
* the wrong category is used in the condition for the last message
  of _xbt_log_cat_init() ("inherited threshold")

The standard logging macros use _XBT_LOG_ISENABLED, which calls
_xbt_log_cat_init().  Thus, if we want to avoid an infinite recursion,
we can not use the standard logging macros in _xbt_log_cat_init(), and
in _xbt_log_cat_apply_set() which is called from it.

To circumvent the problem, we define the macro_xbt_log_init() as (0)
for the length of the affected functions, and we do not forget to
undefine it at the end!

This permits to make the code far more readable.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7977 48e7efb5-ca39-0410-a469-dd3cf9ba447f
src/xbt/log.c