Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
7df75c3aebeee9bdc44838f3908b7dfa0b876d06
[simgrid.git] / include / xbt / log.h
1 /* $Id$ */
2
3 /* log - a generic logging facility in the spirit of log4j                  */
4
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
6
7 /* This program is free software; you can redistribute it and/or modify it
8  * under the terms of the license (GNU LGPL) which comes with this package. */
9
10 /** @addtogroup XBT_log
11  *  @brief A generic logging facility in the spirit of log4j (grounding feature)
12  *
13  *
14  */
15  
16 /** \defgroup XBT_log_cats Existing log categories
17  *  \ingroup XBT_log
18  *  \brief (automatically extracted) 
19  *     
20  *  This is the list of all existing log categories in SimGrid.
21  *  This list was automatically extracted from the source code by
22  *  the src/xbt_log_extract_hierarchy utility.
23  *     
24  *  You can thus be certain that it is uptodate, but it may somehow
25  *  lack a final manual touch.
26  *  Anyway, nothing's perfect ;)
27  */
28
29 /* XBT_LOG_MAYDAY: define this to replace the logging facilities with basic
30    printf function. Useful to debug the logging facilities themselves */
31 #undef XBT_LOG_MAYDAY
32 /*#define XBT_LOG_MAYDAY*/
33
34 #ifndef _XBT_LOG_H_
35 #define _XBT_LOG_H_
36
37 #include "xbt/misc.h"
38
39 #include <stdarg.h>
40 SG_BEGIN_DECL()
41 /**\brief Log priorities
42  * \ingroup XBT_log
43  *
44  * The different existing priorities.
45 */
46 typedef enum {
47   xbt_log_priority_none          = 0,  /* used internally (don't poke with) */
48   xbt_log_priority_trace         = 1,  /**< enter and return of some functions */
49   xbt_log_priority_debug         = 2,  /**< crufty output  */
50   xbt_log_priority_verbose       = 3,  /**< verbose output for the user wanting more */
51   xbt_log_priority_info          = 4,  /**< output about the regular functionning */
52   xbt_log_priority_warning       = 5,  /**< minor issue encountered */
53   xbt_log_priority_error         = 6,  /**< issue encountered */
54   xbt_log_priority_critical      = 7,  /**< major issue encountered */
55
56   xbt_log_priority_infinite      = 8,  /**< value for XBT_LOG_STATIC_THRESHOLD to not log */
57
58   xbt_log_priority_uninitialized = -1  /* used internally (don't poke with) */
59 } e_xbt_log_priority_t;
60               
61
62 /*
63  * define NLOG to disable at compilation time any logging request
64  * define NDEBUG to disable at compilation time any logging request of priority below INFO
65  */
66
67
68 /**
69  * @def XBT_LOG_STATIC_THRESHOLD
70  * @ingroup XBT_log
71  *
72  * All logging requests with priority < XBT_LOG_STATIC_THRESHOLD are disabled at
73  * compile time, i.e., compiled out.
74  */
75 #ifdef NLOG
76 #  define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_infinite
77 #else
78
79 #  ifdef NDEBUG
80 #    define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_verbose
81 #  else /* !NLOG && !NDEBUG */
82
83 #    ifndef XBT_LOG_STATIC_THRESHOLD
84 #      define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_none
85 #    endif /* !XBT_LOG_STATIC_THRESHOLD */
86 #  endif /* NDEBUG */
87 #endif /* !defined(NLOG) */
88
89 /* Transforms a category name to a global variable name. */
90 #define _XBT_LOGV(cat)   _XBT_LOG_CONCAT(_simgrid_this_log_category_does_not_exist__, cat)
91 #define _XBT_LOG_CONCAT(x,y) x ## y
92
93 /* The root of the category hierarchy. */
94 #define XBT_LOG_ROOT_CAT   root
95
96 /* XBT_LOG_NEW_SUBCATEGORY_helper:
97  * Implementation of XBT_LOG_NEW_SUBCATEGORY, which must declare "extern parent" in addition
98  * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
99  * XBT_LOG_NEW_CATEGORY */
100 #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
101     XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(catName) = {       \
102         &_XBT_LOGV(parent),                             \
103         NULL /* firstChild */,                          \
104         NULL /* nextSibling */,                         \
105         #catName,                                       \
106         xbt_log_priority_uninitialized /* threshold */, \
107         1 /* isThreshInherited */,                      \
108         NULL /* appender */,                            \
109         NULL /* layout */,                              \
110         1 /* additivity */                              \
111     }
112 /**
113  * \ingroup XBT_log
114  * \param catName name of new category
115  * \param parent father of the new category in the tree
116  * \param desc string describing the purpose of this category
117  * \hideinitializer
118  *
119  * Defines a new subcategory of the parent. 
120  */
121 #define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc)    \
122     XBT_PUBLIC_DATA(s_xbt_log_category_t) _XBT_LOGV(parent); \
123     XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
124
125 /**
126  * \ingroup XBT_log  
127  * \param catName name of new category
128  * \param desc string describing the purpose of this category
129  * \hideinitializer
130  *
131  * Creates a new subcategory of the root category.
132  */
133 # define XBT_LOG_NEW_CATEGORY(catName,desc)  \
134    XBT_LOG_NEW_SUBCATEGORY_helper(catName, XBT_LOG_ROOT_CAT, desc)  
135
136
137 /**
138  * \ingroup XBT_log  
139  * \param cname name of the cat
140  * \hideinitializer
141  *
142  * Indicates which category is the default one.
143  */
144
145 #if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
146 # define XBT_LOG_DEFAULT_CATEGORY(cname)
147 #else
148 # define XBT_LOG_DEFAULT_CATEGORY(cname) \
149          static xbt_log_category_t _XBT_LOGV(default) _XBT_GNUC_UNUSED = &_XBT_LOGV(cname) 
150 #endif
151
152 /**
153  * \ingroup XBT_log  
154  * \param cname name of the cat
155  * \param desc string describing the purpose of this category
156  * \hideinitializer
157  *
158  * Creates a new subcategory of the root category and makes it the default
159  * (used by macros that don't explicitly specify a category).
160  */
161 /* Damnit Malek. There is no difference between the WINDOWS version and the regular one.
162  * Moreover, portability cruft MUST be kept out of this file. If you need another definition of EXPORT_NO_IMPORT, do so in misc, not here.
163  * Killing your crufty definition once again (I hate dupplicated code). Please do not readd them without a good justification
164
165 #if (defined(_WIN32) && !defined(DLL_STATIC))
166 # define XBT_LOG_NEW_ROOT_SUBCATEGORY(cname,desc) \
167         XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(cname) = {       \
168         0, 0, 0,                    \
169                 #cname, xbt_log_priority_uninitialized, 1, \
170         0, 0, 1                                          \
171     }
172 # define XBT_LOG_NEW_DEFAULT_CATEGORY(cname,desc)        \
173         XBT_LOG_NEW_ROOT_SUBCATEGORY(cname,desc); \
174         XBT_LOG_DEFAULT_CATEGORY(cname)
175     
176 #else
177  */
178 # define XBT_LOG_NEW_DEFAULT_CATEGORY(cname,desc)        \
179     XBT_LOG_NEW_CATEGORY(cname,desc);                   \
180     XBT_LOG_DEFAULT_CATEGORY(cname)
181 //#endif
182
183
184
185 /**
186  * \ingroup XBT_log  
187  * \param cname name of the cat
188  * \param parent name of the parent
189  * \param desc string describing the purpose of this category
190  * \hideinitializer
191  *
192  * Creates a new subcategory of the parent category and makes it the default
193  * (used by macros that don't explicitly specify a category).
194  */
195 #define XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent, desc) \
196     XBT_LOG_NEW_SUBCATEGORY(cname, parent, desc);            \
197     XBT_LOG_DEFAULT_CATEGORY(cname)
198
199 /**
200  * \ingroup XBT_log  
201  * \param cname name of the cat
202  * \hideinitializer
203  *
204  * Indicates that a category you'll use in this file (to get subcategories of it, 
205  * for example) really lives in another file.
206  */
207
208 #define XBT_LOG_EXTERNAL_CATEGORY(cname) \
209    extern s_xbt_log_category_t _XBT_LOGV(cname)
210
211 /**
212  * \ingroup XBT_log
213  * \param cname name of the cat
214  * \hideinitializer
215  *
216  * Indicates that the default category of this file was declared in another file.
217  */
218
219 #define XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(cname) \
220    XBT_LOG_EXTERNAL_CATEGORY(cname);\
221    XBT_LOG_DEFAULT_CATEGORY(cname)
222
223 /* Functions you may call */
224
225 XBT_PUBLIC(void) xbt_log_control_set(const char* cs);
226
227 /* Forward declarations */
228 typedef struct xbt_log_appender_s s_xbt_log_appender_t,*xbt_log_appender_t;
229 typedef struct xbt_log_layout_s   s_xbt_log_layout_t,  *xbt_log_layout_t;
230 typedef struct xbt_log_event_s    s_xbt_log_event_t,   *xbt_log_event_t;
231 typedef struct xbt_log_category_s s_xbt_log_category_t,*xbt_log_category_t;
232
233 /*
234  * Do NOT access any members of this structure directly. FIXME: move to private?
235  */
236 #define XBT_LOG_BUFF_SIZE 2048 /* Size of the static string in which we build the log string */
237 struct xbt_log_category_s {
238   xbt_log_category_t parent;
239   xbt_log_category_t firstChild; 
240   xbt_log_category_t nextSibling;
241   const char *name;
242   int threshold;
243   int isThreshInherited;
244   xbt_log_appender_t appender;
245   xbt_log_layout_t layout;
246   int additivity;
247 };
248
249 struct xbt_log_event_s {
250   xbt_log_category_t cat;
251   e_xbt_log_priority_t priority;
252   const char* fileName;
253   const char* functionName;
254   int lineNum; 
255   va_list ap;
256   va_list ap_copy; /* need a copy to launch dynamic layouts when the static ones overflowed */
257   char buffer[XBT_LOG_BUFF_SIZE];
258 };
259
260 /**
261  * \ingroup XBT_log_implem
262  * \param cat the category (not only its name, but the variable)
263  * \param thresholdPriority the priority
264  *
265  * Programatically alters a category's threshold priority (don't use).
266  */
267 XBT_PUBLIC(void) xbt_log_threshold_set(xbt_log_category_t cat,
268                                        e_xbt_log_priority_t thresholdPriority);
269
270 /**
271  * \ingroup XBT_log_implem  
272  * \param cat the category (not only its name, but the variable)
273  * \param parent the parent cat
274  *
275  * Programatically alter a category's parent (don't use).
276  */
277 XBT_PUBLIC(void) xbt_log_parent_set(xbt_log_category_t cat,
278                                 xbt_log_category_t parent);
279
280 /**
281  * \ingroup XBT_log_implem  
282  * \param cat the category (not only its name, but the variable)
283  * \param app the appender
284  *
285  * Programatically sets the category's appender.
286  * (the prefered interface is throught xbt_log_control_set())
287  *
288  */
289 XBT_PUBLIC(void) xbt_log_appender_set(xbt_log_category_t cat,
290                                       xbt_log_appender_t app);
291 /**
292  * \ingroup XBT_log_implem  
293  * \param cat the category (not only its name, but the variable)
294  * \param lay the layout
295  *
296  * Programatically sets the category's layout.
297  * (the prefered interface is throught xbt_log_control_set())
298  *
299  */
300 XBT_PUBLIC(void) xbt_log_layout_set(xbt_log_category_t cat, 
301                                     xbt_log_layout_t lay);
302
303 /**
304  * \ingroup XBT_log_implem  
305  * \param cat the category (not only its name, but the variable)
306  * \param additivity whether logging actions must be passed to parent.
307  *
308  * Programatically sets whether the logging actions must be passed to 
309  * the parent category.
310  * (the prefered interface is throught xbt_log_control_set())
311  *
312  */
313 XBT_PUBLIC(void) xbt_log_additivity_set(xbt_log_category_t cat,
314                                         int additivity);
315
316 /** @brief create a new simple layout 
317  *
318  * This layout is not as flexible as the pattern one
319  */
320 XBT_PUBLIC(xbt_log_layout_t) xbt_log_layout_simple_new(char*arg);
321 XBT_PUBLIC(xbt_log_layout_t) xbt_log_layout_format_new(char*arg);
322 XBT_PUBLIC(xbt_log_appender_t) xbt_log_appender_file_new(char*arg);
323
324
325 /* ********************************** */
326 /* Functions that you shouldn't call  */
327 /* ********************************** */
328 XBT_PUBLIC(void) _xbt_log_event_log(xbt_log_event_t ev,
329                                 const char *fmt,
330                                 ...) _XBT_GNUC_PRINTF(2,3);
331
332 XBT_PUBLIC(int) _xbt_log_cat_init(xbt_log_category_t   category,
333                                   e_xbt_log_priority_t priority);
334
335
336 XBT_PUBLIC_DATA(s_xbt_log_category_t) _XBT_LOGV(XBT_LOG_ROOT_CAT);
337
338
339 extern xbt_log_appender_t xbt_log_default_appender;
340 extern xbt_log_layout_t xbt_log_default_layout;
341
342 /* ********************** */
343 /* Public functions again */
344 /* ********************** */
345
346 /**
347  * \ingroup XBT_log 
348  * \param catName name of the category
349  * \param priority minimal priority to be enabled to return true (must be #e_xbt_log_priority_t)
350  * \hideinitializer
351  *
352  * Returns true if the given priority is enabled for the category.
353  * If you have expensive expressions that are computed outside of the log
354  * command and used only within it, you should make its evaluation conditional
355  * using this macro.
356  */
357 #define XBT_LOG_ISENABLED(catName, priority) \
358             _XBT_LOG_ISENABLEDV(_XBT_LOGV(catName), priority)
359
360 /*
361  * Helper function that implements XBT_LOG_ISENABLED.
362  *
363  * NOTES
364  * First part is a compile-time constant.
365  * Call to _log_initCat only happens once.
366  */
367 #define _XBT_LOG_ISENABLEDV(catv, priority)                  \
368        (priority >= XBT_LOG_STATIC_THRESHOLD                 \
369         && priority >= catv.threshold                         \
370         && (catv.threshold != xbt_log_priority_uninitialized \
371             || _xbt_log_cat_init(&catv, priority)) )
372
373 /*
374  * Internal Macros
375  * Some kludge macros to ease maintenance. See how they're used below.
376  *
377  * IMPLEMENTATION NOTE: To reduce the parameter passing overhead of an enabled
378  * message, the many parameters passed to the logging function are packed in a
379  * structure. Since these values will be usually be passed to at least 3
380  * functions, this is a win.
381  * It also allows adding new values (such as a timestamp) without breaking
382  * code. 
383  * Setting the LogEvent's valist member is done inside _log_logEvent.
384  */
385
386 #define _XBT_LOG_PRE(catv, priority) do {                        \
387      if (_XBT_LOG_ISENABLEDV(catv, priority)) {                  \
388          s_xbt_log_event_t _log_ev =                             \
389              {NULL,priority,__FILE__,_XBT_FUNCTION,__LINE__}; \
390                 _log_ev.cat = &(catv);                           \
391               _xbt_log_event_log(&_log_ev                        \
392               
393
394 #define _XBT_LOG_POST                          \
395                         );                      \
396      } } while(0)
397
398
399 /* Logging Macros */
400
401 #ifdef XBT_LOG_MAYDAY
402 # define CLOG0(c, p, f)                   fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__)
403 # define CLOG1(c, p, f,a1)                fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1)               
404 # define CLOG2(c, p, f,a1,a2)             fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2)            
405 # define CLOG3(c, p, f,a1,a2,a3)          fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3)         
406 # define CLOG4(c, p, f,a1,a2,a3,a4)       fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4)      
407 # define CLOG5(c, p, f,a1,a2,a3,a4,a5)    fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5)   
408 # define CLOG6(c, p, f,a1,a2,a3,a4,a5,a6) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6)
409 # define CLOG7(c, p, f,a1,a2,a3,a4,a5,a6,a7) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7)
410 # define CLOG8(c, p, f,a1,a2,a3,a4,a5,a6,a7,a8) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7,a8)
411 # define CLOG9(c, p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7,a8,a9)
412 # define CLOG10(c, p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
413 #else
414 # define CLOG0(c, p, f)                   _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f _XBT_LOG_POST            
415 # define CLOG1(c, p, f,a1)                _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1 _XBT_LOG_POST                 
416 # define CLOG2(c, p, f,a1,a2)             _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2 _XBT_LOG_POST
417 # define CLOG3(c, p, f,a1,a2,a3)          _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3 _XBT_LOG_POST
418 # define CLOG4(c, p, f,a1,a2,a3,a4)       _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4 _XBT_LOG_POST
419 # define CLOG5(c, p, f,a1,a2,a3,a4,a5)    _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4,a5 _XBT_LOG_POST
420 # define CLOG6(c, p, f,a1,a2,a3,a4,a5,a6) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4,a5,a6 _XBT_LOG_POST
421 # define CLOG7(c, p, f,a1,a2,a3,a4,a5,a6,a7) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4,a5,a6,a7 _XBT_LOG_POST
422 # define CLOG8(c, p, f,a1,a2,a3,a4,a5,a6,a7,a8) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8 _XBT_LOG_POST
423 # define CLOG9(c, p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8,a9 _XBT_LOG_POST
424 # define CLOG10(c, p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 _XBT_LOG_POST
425 #endif
426 #define CDEBUG0(c, f)                   CLOG0(c, xbt_log_priority_debug, f)
427 #define CDEBUG1(c, f,a1)                CLOG1(c, xbt_log_priority_debug, f,a1)
428 #define CDEBUG2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_debug, f,a1,a2)
429 #define CDEBUG3(c, f,a1,a2,a3)          CLOG3(c, xbt_log_priority_debug, f,a1,a2,a3)
430 #define CDEBUG4(c, f,a1,a2,a3,a4)       CLOG4(c, xbt_log_priority_debug, f,a1,a2,a3,a4)
431 #define CDEBUG5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5)
432 #define CDEBUG6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
433 #define CDEBUG7(c, f,a1,a2,a3,a4,a5,a6,a7) CLOG7(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7)
434 #define CDEBUG8(c, f,a1,a2,a3,a4,a5,a6,a7,a8) CLOG8(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8)
435 #define CDEBUG9(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) CLOG9(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
436 /** @ingroup XBT_log
437  *  @hideinitializer
438  * \param c the category on which to log
439  * \param f the format string
440  * \param a1 first argument of the format
441  * \param a2 second argument of the format
442  * \param a3 third argument of the format
443  * \param a4 fourth argument of the format
444  * \param a5 fifth argument of the format
445  * \param a6 sixth argument of the format
446  * \param a7 seventh argument of the format
447  * \param a8 eighth argument of the format
448  * \param a9 ninth argument of the format
449  * \param a10 tenth argument of the format
450  *  @brief Log an event at the DEBUG priority on the specified category with these args (CDEBUGn exists for any n<10).
451  */
452 #define CDEBUG10(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) CLOG10(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
453
454 #define CVERB0(c, f)                   CLOG0(c, xbt_log_priority_verbose, f)
455 #define CVERB1(c, f,a1)                CLOG1(c, xbt_log_priority_verbose, f,a1)
456 #define CVERB2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_verbose, f,a1,a2)
457 #define CVERB3(c, f,a1,a2,a3)          CLOG3(c, xbt_log_priority_verbose, f,a1,a2,a3)
458 #define CVERB4(c, f,a1,a2,a3,a4)       CLOG4(c, xbt_log_priority_verbose, f,a1,a2,a3,a4)
459 #define CVERB5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
460 #define CVERB6(c, f,a1,a2,a3,a4,a5,a6)    CLOG6(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
461 #define CVERB7(c, f,a1,a2,a3,a4,a5,a6,a7)    CLOG7(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7)
462 #define CVERB8(c, f,a1,a2,a3,a4,a5,a6,a7,a8)    CLOG8(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7,a8)
463 #define CVERB9(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)    CLOG9(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
464 /** @ingroup XBT_log
465  *  @hideinitializer
466  *  @brief Log an event at the VERB priority on the specified category with these args (CVERBn exists for any n<10).
467  */
468 #define CVERB10(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)    CLOG10(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
469
470 #define CINFO0(c, f)                   CLOG0(c, xbt_log_priority_info, f)
471 #define CINFO1(c, f,a1)                CLOG1(c, xbt_log_priority_info, f,a1)
472 #define CINFO2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_info, f,a1,a2)
473 #define CINFO3(c, f,a1,a2,a3)          CLOG3(c, xbt_log_priority_info, f,a1,a2,a3)
474 #define CINFO4(c, f,a1,a2,a3,a4)       CLOG4(c, xbt_log_priority_info, f,a1,a2,a3,a4)
475 #define CINFO5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5)
476 #define CINFO6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
477 #define CINFO7(c, f,a1,a2,a3,a4,a5,a6,a7) CLOG7(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7)
478 #define CINFO8(c, f,a1,a2,a3,a4,a5,a6,a7,a8) CLOG8(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7,a8)
479 #define CINFO9(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) CLOG9(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
480 /** @ingroup XBT_log
481  *  @hideinitializer
482  *  @brief Log an event at the INFO priority on the specified category with these args (CINFOn exists for any n<10).
483  */
484 #define CINFO10(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) CLOG10(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
485
486 #define CWARN0(c, f)                   CLOG0(c, xbt_log_priority_warning, f)
487 #define CWARN1(c, f,a1)                CLOG1(c, xbt_log_priority_warning, f,a1)
488 #define CWARN2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_warning, f,a1,a2)
489 #define CWARN3(c, f,a1,a2,a3)          CLOG3(c, xbt_log_priority_warning, f,a1,a2,a3)
490 #define CWARN4(c, f,a1,a2,a3,a4)       CLOG4(c, xbt_log_priority_warning, f,a1,a2,a3,a4)
491 #define CWARN5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
492 #define CWARN6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
493 #define CWARN7(c, f,a1,a2,a3,a4,a5,a6,a7) CLOG7(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7)
494 #define CWARN8(c, f,a1,a2,a3,a4,a5,a6,a7,a8) CLOG8(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7,a8)
495 #define CWARN9(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) CLOG9(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
496 /** @ingroup XBT_log
497  *  @hideinitializer
498  *  @brief Log an event at the WARN priority on the specified category with these args (CWARNn exists for any n<10).
499  */
500 #define CWARN10(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) CLOG10(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,10)
501
502 #define CERROR0(c, f)                   CLOG0(c, xbt_log_priority_error, f)
503 #define CERROR1(c, f,a1)                CLOG1(c, xbt_log_priority_error, f,a1)
504 #define CERROR2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_error, f,a1,a2)
505 #define CERROR3(c, f,a1,a2,a3)          CLOG3(c, xbt_log_priority_error, f,a1,a2,a3)
506 #define CERROR4(c, f,a1,a2,a3,a4)       CLOG4(c, xbt_log_priority_error, f,a1,a2,a3,a4)
507 #define CERROR5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5)
508 #define CERROR6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
509 #define CERROR7(c, f,a1,a2,a3,a4,a5,a6,a7) CLOG7(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7)
510 #define CERROR8(c, f,a1,a2,a3,a4,a5,a6,a7,a8) CLOG8(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7,a8)
511 #define CERROR9(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) CLOG9(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
512 /** @ingroup XBT_log
513  *  @hideinitializer
514  *  @brief Log an event at the ERROR priority on the specified category with these args (CERRORn exists for any n<10).
515  */
516 #define CERROR10(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) CLOG10(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
517
518 #define CCRITICAL0(c, f)                   CLOG0(c, xbt_log_priority_critical, f)
519 #define CCRITICAL1(c, f,a1)                CLOG1(c, xbt_log_priority_critical, f,a1)
520 #define CCRITICAL2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_critical, f,a1,a2)
521 #define CCRITICAL3(c, f,a1,a2,a3)          CLOG3(c, xbt_log_priority_critical, f,a1,a2,a3)
522 #define CCRITICAL4(c, f,a1,a2,a3,a4)       CLOG4(c, xbt_log_priority_critical, f,a1,a2,a3,a4)
523 #define CCRITICAL5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
524 #define CCRITICAL6(c, f,a1,a2,a3,a4,a5,a6)    CLOG6(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
525 #define CCRITICAL7(c, f,a1,a2,a3,a4,a5,a6,a7)    CLOG7(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7)
526 #define CCRITICAL8(c, f,a1,a2,a3,a4,a5,a6,a7,a8)    CLOG8(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7,a8)
527 #define CCRITICAL9(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)    CLOG9(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
528 /** @ingroup XBT_log
529  *  @hideinitializer
530  *  @brief Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10).
531  */
532 #define CCRITICAL10(c, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)    CLOG10(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
533
534 #ifdef XBT_LOG_MAYDAY
535 # define LOG0(p, f)                   fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__)
536 # define LOG1(p, f,a1)                fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1)               
537 # define LOG2(p, f,a1,a2)             fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2)            
538 # define LOG3(p, f,a1,a2,a3)          fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3)         
539 # define LOG4(p, f,a1,a2,a3,a4)       fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4)      
540 # define LOG5(p, f,a1,a2,a3,a4,a5)    fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5)   
541 # define LOG6(p, f,a1,a2,a3,a4,a5,a6) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6)
542 # define LOG7(p, f,a1,a2,a3,a4,a5,a6,a7) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7)
543 # define LOG8(p, f,a1,a2,a3,a4,a5,a6,a7,a8) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7,a8)
544 # define LOG9(p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7,a8,a9)
545 # define LOG10(p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
546 #else
547 # define LOG0(p, f)                   _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f _XBT_LOG_POST
548 # define LOG1(p, f,a1)                _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1 _XBT_LOG_POST
549 # define LOG2(p, f,a1,a2)             _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2 _XBT_LOG_POST
550 # define LOG3(p, f,a1,a2,a3)          _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3 _XBT_LOG_POST
551 # define LOG4(p, f,a1,a2,a3,a4)       _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4 _XBT_LOG_POST
552 # define LOG5(p, f,a1,a2,a3,a4,a5)    _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5 _XBT_LOG_POST
553 # define LOG6(p, f,a1,a2,a3,a4,a5,a6) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5,a6 _XBT_LOG_POST
554 # define LOG7(p, f,a1,a2,a3,a4,a5,a6,a7) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5,a6,a7 _XBT_LOG_POST
555 # define LOG8(p, f,a1,a2,a3,a4,a5,a6,a7,a8) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8 _XBT_LOG_POST
556 # define LOG9(p, f,a1,a2,a3,a4,a5,a6,a7,a8,a9) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8,a9 _XBT_LOG_POST
557 # define LOG10(p,f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 _XBT_LOG_POST
558 #endif
559
560 #define DEBUG0(f)                   LOG0(xbt_log_priority_debug, f)
561 #define DEBUG1(f,a1)                LOG1(xbt_log_priority_debug, f,a1)
562 #define DEBUG2(f,a1,a2)             LOG2(xbt_log_priority_debug, f,a1,a2)
563 #define DEBUG3(f,a1,a2,a3)          LOG3(xbt_log_priority_debug, f,a1,a2,a3)
564 #define DEBUG4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_debug, f,a1,a2,a3,a4)
565 #define DEBUG5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_debug, f,a1,a2,a3,a4,a5)
566 #define DEBUG6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
567 #define DEBUG7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7)
568 #define DEBUG8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8)
569 #define DEBUG9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) LOG9(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
570 /** @ingroup XBT_log
571  *  @hideinitializer
572  * \param f the format string
573  * \param a1 first argument of the format
574  * \param a2 second argument of the format
575  * \param a3 third argument of the format
576  * \param a4 fourth argument of the format
577  * \param a5 fifth argument of the format
578  * \param a6 sixth argument of the format
579  * \param a7 seventh argument of the format
580  * \param a8 eighth argument of the format
581  * \param a9 ninth argument of the format
582  * \param a10 tenth argument of the format
583  *  @brief Log an event at the DEBUG priority on the default category with these args (DEBUGn exists for any n<10)
584  */
585 #define DEBUG10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) LOG10(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
586
587 #define VERB0(f)                   LOG0(xbt_log_priority_verbose, f)
588 #define VERB1(f,a1)                LOG1(xbt_log_priority_verbose, f,a1)
589 #define VERB2(f,a1,a2)             LOG2(xbt_log_priority_verbose, f,a1,a2)
590 #define VERB3(f,a1,a2,a3)          LOG3(xbt_log_priority_verbose, f,a1,a2,a3)
591 #define VERB4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_verbose, f,a1,a2,a3,a4)
592 #define VERB5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
593 #define VERB6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
594 #define VERB7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7)
595 #define VERB8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7,a8)
596 #define VERB9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) LOG9(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
597 /** @ingroup XBT_log
598  *  @hideinitializer
599  *  @brief Log an event at the VERB priority on the default category with these args (VERBn exists for any n<10).
600  */
601 #define VERB10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) LOG10(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
602
603 #define INFO0(f)                   LOG0(xbt_log_priority_info, f)
604 #define INFO1(f,a1)                LOG1(xbt_log_priority_info, f,a1)
605 #define INFO2(f,a1,a2)             LOG2(xbt_log_priority_info, f,a1,a2)
606 #define INFO3(f,a1,a2,a3)          LOG3(xbt_log_priority_info, f,a1,a2,a3)
607 #define INFO4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_info, f,a1,a2,a3,a4)
608 #define INFO5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_info, f,a1,a2,a3,a4,a5)
609 #define INFO6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
610 #define INFO7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7)
611 #define INFO8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7,a8)
612 #define INFO9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) LOG9(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
613 /** @ingroup XBT_log
614  *  @hideinitializer
615  *  @brief Log an event at the INFO priority on the default category with these args (INFOn exists for any n<10).
616  */
617 #define INFO10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) LOG10(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
618
619 #define WARN0(f)                   LOG0(xbt_log_priority_warning, f)
620 #define WARN1(f,a1)                LOG1(xbt_log_priority_warning, f,a1)
621 #define WARN2(f,a1,a2)             LOG2(xbt_log_priority_warning, f,a1,a2)
622 #define WARN3(f,a1,a2,a3)          LOG3(xbt_log_priority_warning, f,a1,a2,a3)
623 #define WARN4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_warning, f,a1,a2,a3,a4)
624 #define WARN5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
625 #define WARN6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
626 #define WARN7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7)
627 #define WARN8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7,a8)
628 #define WARN9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) LOG9(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
629 /** @ingroup XBT_log
630  *  @hideinitializer
631  *  @brief Log an event at the WARN priority on the default category with these args (WARNn exists for any n<10).
632  */
633 #define WARN10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) LOG10(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
634
635
636 #define ERROR0(f)                   LOG0(xbt_log_priority_error, f)
637 #define ERROR1(f,a1)                LOG1(xbt_log_priority_error, f,a1)
638 #define ERROR2(f,a1,a2)             LOG2(xbt_log_priority_error, f,a1,a2)
639 #define ERROR3(f,a1,a2,a3)          LOG3(xbt_log_priority_error, f,a1,a2,a3)
640 #define ERROR4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_error, f,a1,a2,a3,a4)
641 #define ERROR5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_error, f,a1,a2,a3,a4,a5)
642 #define ERROR6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
643 #define ERROR7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7)
644 #define ERROR8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7,a8)
645 #define ERROR9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) LOG9(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
646 /** @ingroup XBT_log
647  *  @hideinitializer
648  *  @brief Log an event at the ERROR priority on the default category with these args (ERRORn exists for any n<10).
649  */
650 #define ERROR10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) LOG10(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
651
652 #define CRITICAL0(f)                   LOG0(xbt_log_priority_critical, f)
653 #define CRITICAL1(f,a1)                LOG1(xbt_log_priority_critical, f,a1)
654 #define CRITICAL2(f,a1,a2)             LOG2(xbt_log_priority_critical, f,a1,a2)
655 #define CRITICAL3(f,a1,a2,a3)          LOG3(xbt_log_priority_critical, f,a1,a2,a3)
656 #define CRITICAL4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_critical, f,a1,a2,a3,a4)
657 #define CRITICAL5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
658 #define CRITICAL6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
659 #define CRITICAL7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7)
660 #define CRITICAL8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7,a8)
661 #define CRITICAL9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) LOG9(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7,a8,a9)
662 /** @ingroup XBT_log
663  *  @hideinitializer
664  *  @brief Log an event at the CRITICAL priority on the default category with these args (CRITICALn exists for any n<10).
665  */
666 #define CRITICAL10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) LOG10(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
667
668 /** @ingroup XBT_log
669  *  @hideinitializer
670  *  @brief Log at TRACE priority that we entered in current function.
671  */
672 #define XBT_IN               LOG1(xbt_log_priority_trace, ">> begin of %s",     _XBT_FUNCTION)
673 #define XBT_IN1(fmt,a)       LOG2(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a)
674 #define XBT_IN2(fmt,a,b)     LOG3(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b)
675 #define XBT_IN3(fmt,a,b,c)   LOG4(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c)
676 #define XBT_IN4(fmt,a,b,c,d) LOG5(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d)
677 /** @ingroup XBT_log
678  *  @hideinitializer
679  *  @brief Log at TRACE priority that we entered in current function, appending a user specified format taking 5 args (XBT_INn exists for all n in [1,6])
680  */
681 #define XBT_IN5(fmt,a,b,c,d,e) LOG6(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d,e)
682 /** @ingroup XBT_log
683  *  @hideinitializer
684  *  @brief Log at TRACE priority that we exited the current function.
685  */
686 #define XBT_OUT              LOG1(xbt_log_priority_trace, "<< end of %s",       _XBT_FUNCTION)
687 /** @ingroup XBT_log
688  *  @hideinitializer
689  *  @brief Log at TRACE priority a message indicating that we reached that point.
690  */
691 #define XBT_HERE             LOG0(xbt_log_priority_trace, "-- was here")
692
693
694 SG_END_DECL()
695
696 #endif /* ! _XBT_LOG_H_ */