From a50fad0ece7cf975227c3b8bbae84fb158c6b4e4 Mon Sep 17 00:00:00 2001 From: mquinson Date: Sun, 16 Jul 2006 14:14:03 +0000 Subject: [PATCH] Documentation improvements git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2589 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/log.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/xbt/log.c b/src/xbt/log.c index 4b72fff99e..efc8727a48 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -204,17 +204,28 @@ First of all, each module should register its own category into the categories tree using \ref XBT_LOG_NEW_DEFAULT_SUBCATEGORY. Then, logging should be done with the DEBUG, VERB, INFO, WARN, -ERROR or CRITICAL macro families. For each group, there is 6 different -macros (like DEBUG0, DEBUG1, DEBUG2, DEBUG3, DEBUG4 and DEBUG5), only differing -in the number of arguments passed along the format. This is because we want -SimGrid itself to keep compilable on ancient compiler not supporting variable -number of arguments to macros. But we should provide a macro simpler to use for -the users not interested in SP3 machines (FIXME). - +ERROR or CRITICAL macro families (such as #DEBUG10, #VERB6, +#INFO8, #WARN6, #ERROR6 and #CRITICAL6). For each group, there is at +least 6 different macros (like DEBUG0, DEBUG1, DEBUG2, DEBUG3, DEBUG4 and +DEBUG5), only differing in the number of arguments passed along the format. +This is because we want SimGrid itself to keep compilable on ancient +compiler not supporting variable number of arguments to macros. But we +should provide a macro simpler to use for the users not interested in SP3 +machines (FIXME). + Under GCC, these macro check there arguments the same way than printf does. So, if you compile with -Wall, the folliwing code will issue a warning: DEBUG2("Found %s (id %f)", some_string, a_double) +If you want to specify the category to log onto (for example because you +have more than one category per file, add a C before the name of the log +producing macro (ie, use #CDEBUG10, #CVERB6, #CINFO8, #CWARN6, #CERROR6 and +#CCRITICAL6 and friends), and pass the category name as first argument. + +The TRACE priority is not used the same way than the other. You should use +the #XBT_IN, XBT_IN (up to #XBT_IN5), #XBT_OUT and #XBT_HERE macros +instead. + \section log_API_example 2.5 Example of use Here is a more complete example: -- 2.20.1