3 /* log - a generic logging facility in the spirit of log4j */
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */
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. */
10 /** @addtogroup XBT_log
11 * @brief A generic logging facility in the spirit of log4j (grounding feature)
13 * <center><table><tr><td><b>Top</b> <td> [\ref index]::[\ref XBT_API]
14 * <tr><td><b>Prev</b> <td> [\ref XBT_ex]
15 * <tr><td><b>Next</b> <td> [\ref XBT_error]
16 * <tr><td><b>Down</b> <td> [\ref XBT_log_cats] </table></center>
20 /** \defgroup XBT_log_cats Existing log categories
22 * \brief (automatically extracted)
24 * <center><table><tr><td><b>Top</b> <td> [\ref index]::[\ref XBT_API]::[\ref XBT_log] </table></center>
26 * This is the list of all existing log categories in SimGrid.
27 * This list was automatically extracted from the source code by
28 * the src/xbt_log_extract_hierarchy utility.
30 * You can thus be certain that it is uptodate, but it may somehow
31 * lack a final manual touch.
32 * Anyway, nothing's perfect ;)
35 /* XBT_LOG_MAYDAY: define this to replace the logging facilities with basic
36 printf function. Useful to debug the logging facilities themselves */
38 /*#define XBT_LOG_MAYDAY*/
47 /**\brief Log priorities
50 * The different existing priorities.
53 xbt_log_priority_none = 0, /* used internally (don't poke with) */
54 xbt_log_priority_trace = 1, /**< enter and return of some functions */
55 xbt_log_priority_debug = 2, /**< crufty output */
56 xbt_log_priority_verbose = 3, /**< verbose output for the user wanting more */
57 xbt_log_priority_info = 4, /**< output about the regular functionning */
58 xbt_log_priority_warning = 5, /**< minor issue encountered */
59 xbt_log_priority_error = 6, /**< issue encountered */
60 xbt_log_priority_critical = 7, /**< major issue encountered */
62 xbt_log_priority_infinite = 8, /**< value for XBT_LOG_STATIC_THRESHOLD to not log */
64 xbt_log_priority_uninitialized = -1 /* used internally (don't poke with) */
65 } e_xbt_log_priority_t;
69 * define NLOG to disable at compilation time any logging request
70 * define NDEBUG to disable at compilation time any logging request of priority below INFO
75 * @def XBT_LOG_STATIC_THRESHOLD
78 * All logging requests with priority < XBT_LOG_STATIC_THRESHOLD are disabled at
79 * compile time, i.e., compiled out.
82 # define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_infinite
86 # define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_verbose
87 # else /* !NLOG && !NDEBUG */
89 # ifndef XBT_LOG_STATIC_THRESHOLD
90 # define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_none
91 # endif /* !XBT_LOG_STATIC_THRESHOLD */
93 #endif /* !defined(NLOG) */
95 /* Transforms a category name to a global variable name. */
96 #define _XBT_LOGV(cat) _XBT_LOG_CONCAT(_gras_this_log_category_does_not_exist__, cat)
97 #define _XBT_LOG_CONCAT(x,y) x ## y
99 /* The root of the category hierarchy. */
100 #define XBT_LOG_ROOT_CAT root
102 /* XBT_LOG_NEW_SUBCATEGORY_helper:
103 * Implementation of XBT_LOG_NEW_SUBCATEGORY, which must declare "extern parent" in addition
104 * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
105 * XBT_LOG_NEW_CATEGORY */
106 #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
107 s_xbt_log_category_t _XBT_LOGV(catName) = { \
108 &_XBT_LOGV(parent), 0, 0, \
109 #catName, xbt_log_priority_uninitialized, 1, \
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
119 * Defines a new subcategory of the parent.
121 #define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc) \
122 extern s_xbt_log_category_t _XBT_LOGV(parent); \
123 XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
127 * \param catName name of new category
128 * \param desc string describing the purpose of this category
131 * Creates a new subcategory of the root category.
133 #define XBT_LOG_NEW_CATEGORY(catName,desc) XBT_LOG_NEW_SUBCATEGORY_helper(catName, XBT_LOG_ROOT_CAT, desc)
137 * \param cname name of the cat
140 * Indicates which category is the default one.
143 #if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
144 # define XBT_LOG_DEFAULT_CATEGORY(cname)
146 # define XBT_LOG_DEFAULT_CATEGORY(cname) \
147 static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname)
152 * \param cname name of the cat
153 * \param desc string describing the purpose of this category
156 * Creates a new subcategory of the root category and makes it the default
157 * (used by macros that don't explicitly specify a category).
159 #define XBT_LOG_NEW_DEFAULT_CATEGORY(cname,desc) \
160 XBT_LOG_NEW_CATEGORY(cname,desc); \
161 XBT_LOG_DEFAULT_CATEGORY(cname)
165 * \param cname name of the cat
166 * \param parent name of the parent
167 * \param desc string describing the purpose of this category
170 * Creates a new subcategory of the parent category and makes it the default
171 * (used by macros that don't explicitly specify a category).
173 #define XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent, desc) \
174 XBT_LOG_NEW_SUBCATEGORY(cname, parent, desc); \
175 XBT_LOG_DEFAULT_CATEGORY(cname)
179 * \param cname name of the cat
182 * Indicates that a category you'll use in this file (to get subcategories of it,
183 * for example) really lives in another file.
186 #define XBT_LOG_EXTERNAL_CATEGORY(cname) \
187 extern s_xbt_log_category_t _XBT_LOGV(cname)
189 /* Functions you may call */
191 extern void xbt_log_control_set(const char* cs);
193 /* Forward declarations */
194 typedef struct xbt_log_appender_s s_xbt_log_appender_t,*xbt_log_appender_t;
195 typedef struct xbt_log_event_s s_xbt_log_event_t, *xbt_log_event_t;
196 typedef struct xbt_log_category_s s_xbt_log_category_t,*xbt_log_category_t;
199 * Do NOT access any members of this structure directly. FIXME: move to private?
201 struct xbt_log_category_s {
202 xbt_log_category_t parent;
203 /*@null@*/ xbt_log_category_t firstChild;
204 /*@null@*/ xbt_log_category_t nextSibling;
207 int isThreshInherited;
208 /*@null@*/ xbt_log_appender_t appender;
213 struct xbt_log_appender_s {
214 void (*do_append) (xbt_log_appender_t thisLogAppender,
215 xbt_log_event_t event, const char *fmt);
219 struct xbt_log_event_s {
220 xbt_log_category_t cat;
221 e_xbt_log_priority_t priority;
222 const char* fileName;
223 const char* functionName;
229 * \ingroup XBT_log_implem
230 * \param cat the category (not only its name, but the variable)
231 * \param thresholdPriority the priority
233 * Programatically alters a category's threshold priority (don't use).
235 extern void xbt_log_threshold_set(xbt_log_category_t cat,
236 e_xbt_log_priority_t thresholdPriority);
239 * \ingroup XBT_log_implem
240 * \param cat the category (not only its name, but the variable)
241 * \param parent the parent cat
243 * Programatically alter a category's parent (don't use).
245 extern void xbt_log_parent_set(xbt_log_category_t cat,
246 xbt_log_category_t parent);
249 * \ingroup XBT_log_implem
250 * \param cat the category (not only its name, but the variable)
251 * \param app the appender
253 * Programatically sets the category's appender (don't use).
255 extern void xbt_log_appender_set(xbt_log_category_t cat,
256 xbt_log_appender_t app);
258 /* Functions that you shouldn't call. */
259 extern void _xbt_log_event_log(xbt_log_event_t ev,
261 ...) _XBT_GNUC_PRINTF(2,3);
263 extern int _xbt_log_cat_init(e_xbt_log_priority_t priority,
264 xbt_log_category_t category);
267 extern s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT);
268 XBT_LOG_EXTERNAL_CATEGORY(GRAS);
269 extern xbt_log_appender_t xbt_log_default_appender;
273 * \param catName name of the category
274 * \param priority minimal priority to be enabled to return true
277 * Returns true if the given priority is enabled for the category.
278 * If you have expensive expressions that are computed outside of the log
279 * command and used only within it, you should make its evaluation conditional
282 #define XBT_LOG_ISENABLED(catName, priority) \
283 _XBT_LOG_ISENABLEDV(_XBT_LOGV(catName), priority)
286 * Helper function that implements XBT_LOG_ISENABLED.
289 * First part is a compile-time constant.
290 * Call to _log_initCat only happens once.
292 #define _XBT_LOG_ISENABLEDV(catv, priority) \
293 (priority >= XBT_LOG_STATIC_THRESHOLD \
294 && priority >= catv.threshold \
295 && (catv.threshold != xbt_log_priority_uninitialized \
296 || _xbt_log_cat_init(priority, &catv)) )
300 * Some kludge macros to ease maintenance. See how they're used below.
302 * IMPLEMENTATION NOTE: To reduce the parameter passing overhead of an enabled
303 * message, the many parameters passed to the logging function are packed in a
304 * structure. Since these values will be usually be passed to at least 3
305 * functions, this is a win.
306 * It also allows adding new values (such as a timestamp) without breaking
308 * Setting the LogEvent's valist member is done inside _log_logEvent.
311 #define _XBT_LOG_PRE(catv, priority) do { \
312 if (_XBT_LOG_ISENABLEDV(catv, priority)) { \
313 s_xbt_log_event_t _log_ev = \
314 {&(catv),priority,__FILE__,_XBT_FUNCTION,__LINE__}; \
315 _xbt_log_event_log(&_log_ev
317 #define _XBT_LOG_POST \
324 #ifdef XBT_LOG_MAYDAY
325 # define CLOG0(c, p, f) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__)
326 # define CLOG1(c, p, f,a1) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1)
327 # define CLOG2(c, p, f,a1,a2) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2)
328 # define CLOG3(c, p, f,a1,a2,a3) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3)
329 # define CLOG4(c, p, f,a1,a2,a3,a4) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4)
330 # define CLOG5(c, p, f,a1,a2,a3,a4,a5) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5)
331 # 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)
332 # 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)
333 # 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)
335 # define CLOG0(c, p, f) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f _XBT_LOG_POST
336 # define CLOG1(c, p, f,a1) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1 _XBT_LOG_POST
337 # define CLOG2(c, p, f,a1,a2) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2 _XBT_LOG_POST
338 # define CLOG3(c, p, f,a1,a2,a3) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3 _XBT_LOG_POST
339 # define CLOG4(c, p, f,a1,a2,a3,a4) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4 _XBT_LOG_POST
340 # 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
341 # 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
342 # 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
343 # 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
346 #define CDEBUG0(c, f) CLOG0(c, xbt_log_priority_debug, f)
347 #define CDEBUG1(c, f,a1) CLOG1(c, xbt_log_priority_debug, f,a1)
348 #define CDEBUG2(c, f,a1,a2) CLOG2(c, xbt_log_priority_debug, f,a1,a2)
349 #define CDEBUG3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_debug, f,a1,a2,a3)
350 #define CDEBUG4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_debug, f,a1,a2,a3,a4)
351 #define CDEBUG5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5)
352 #define CDEBUG6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
353 #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)
354 #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)
356 #define CVERB0(c, f) CLOG0(c, xbt_log_priority_verbose, f)
357 #define CVERB1(c, f,a1) CLOG1(c, xbt_log_priority_verbose, f,a1)
358 #define CVERB2(c, f,a1,a2) CLOG2(c, xbt_log_priority_verbose, f,a1,a2)
359 #define CVERB3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_verbose, f,a1,a2,a3)
360 #define CVERB4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_verbose, f,a1,a2,a3,a4)
361 #define CVERB5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
362 #define CVERB6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
364 #define CINFO0(c, f) CLOG0(c, xbt_log_priority_info, f)
365 #define CINFO1(c, f,a1) CLOG1(c, xbt_log_priority_info, f,a1)
366 #define CINFO2(c, f,a1,a2) CLOG2(c, xbt_log_priority_info, f,a1,a2)
367 #define CINFO3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_info, f,a1,a2,a3)
368 #define CINFO4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_info, f,a1,a2,a3,a4)
369 #define CINFO5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5)
370 #define CINFO6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
372 #define CWARN0(c, f) CLOG0(c, xbt_log_priority_warning, f)
373 #define CWARN1(c, f,a1) CLOG1(c, xbt_log_priority_warning, f,a1)
374 #define CWARN2(c, f,a1,a2) CLOG2(c, xbt_log_priority_warning, f,a1,a2)
375 #define CWARN3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_warning, f,a1,a2,a3)
376 #define CWARN4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_warning, f,a1,a2,a3,a4)
377 #define CWARN5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
378 #define CWARN6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
380 #define CERROR0(c, f) CLOG0(c, xbt_log_priority_error, f)
381 #define CERROR1(c, f,a1) CLOG1(c, xbt_log_priority_error, f,a1)
382 #define CERROR2(c, f,a1,a2) CLOG2(c, xbt_log_priority_error, f,a1,a2)
383 #define CERROR3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_error, f,a1,a2,a3)
384 #define CERROR4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_error, f,a1,a2,a3,a4)
385 #define CERROR5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5)
386 #define CERROR6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
388 #define CCRITICAL0(c, f) CLOG0(c, xbt_log_priority_critical, f)
389 #define CCRITICAL1(c, f,a1) CLOG1(c, xbt_log_priority_critical, f,a1)
390 #define CCRITICAL2(c, f,a1,a2) CLOG2(c, xbt_log_priority_critical, f,a1,a2)
391 #define CCRITICAL3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_critical, f,a1,a2,a3)
392 #define CCRITICAL4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_critical, f,a1,a2,a3,a4)
393 #define CCRITICAL5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
394 #define CCRITICAL6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
396 #ifdef XBT_LOG_MAYDAY
397 # define LOG0(p, f) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__)
398 # define LOG1(p, f,a1) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1)
399 # define LOG2(p, f,a1,a2) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2)
400 # define LOG3(p, f,a1,a2,a3) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3)
401 # define LOG4(p, f,a1,a2,a3,a4) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4)
402 # define LOG5(p, f,a1,a2,a3,a4,a5) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5)
403 # define LOG6(p, f,a1,a2,a3,a4,a5,a6) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6)
404 # 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)
405 # 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)
407 # define LOG0(p, f) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f _XBT_LOG_POST
408 # define LOG1(p, f,a1) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1 _XBT_LOG_POST
409 # define LOG2(p, f,a1,a2) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2 _XBT_LOG_POST
410 # define LOG3(p, f,a1,a2,a3) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3 _XBT_LOG_POST
411 # define LOG4(p, f,a1,a2,a3,a4) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4 _XBT_LOG_POST
412 # 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
413 # 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
414 # 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
415 # 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
420 * Log something to the current default category under the debug priority.
421 * \param f the format string
422 * \param a1 first argument of the format
423 * \param a2 second argument of the format
424 * \param a3 third argument of the format
425 * \param a4 fourth argument of the format
426 * \param a5 fifth argument of the format
427 * \param a6 sixth argument of the format
429 * The macros DEBUG0 ... DEBUG5 naturally also exist, but are not listed here
430 * for sake of clarity. They just differ in the number of arguments passed
431 * along with the format string.
434 #define DEBUG0(f) LOG0(xbt_log_priority_debug, f)
435 #define DEBUG1(f,a1) LOG1(xbt_log_priority_debug, f,a1)
436 #define DEBUG2(f,a1,a2) LOG2(xbt_log_priority_debug, f,a1,a2)
437 #define DEBUG3(f,a1,a2,a3) LOG3(xbt_log_priority_debug, f,a1,a2,a3)
438 #define DEBUG4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_debug, f,a1,a2,a3,a4)
439 #define DEBUG5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_debug, f,a1,a2,a3,a4,a5)
440 #define DEBUG6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
441 #define DEBUG7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7)
442 #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)
447 * Log something to the current default category under the verbose priority.
448 * \param f the format string
449 * \param a1 first argument of the format
450 * \param a2 second argument of the format
451 * \param a3 third argument of the format
452 * \param a4 fourth argument of the format
453 * \param a5 fifth argument of the format
454 * \param a6 sixth argument of the format
456 * The macros VERB0 ... VERB5 naturally also exist, but are not listed here
457 * for sake of clarity. They just differ in the number of arguments passed
458 * along with the format string.
461 #define VERB0(f) LOG0(xbt_log_priority_verbose, f)
462 #define VERB1(f,a1) LOG1(xbt_log_priority_verbose, f,a1)
463 #define VERB2(f,a1,a2) LOG2(xbt_log_priority_verbose, f,a1,a2)
464 #define VERB3(f,a1,a2,a3) LOG3(xbt_log_priority_verbose, f,a1,a2,a3)
465 #define VERB4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_verbose, f,a1,a2,a3,a4)
466 #define VERB5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
467 #define VERB6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
472 * Log something to the current default category under the info priority.
473 * \param f the format string
474 * \param a1 first argument of the format
475 * \param a2 second argument of the format
476 * \param a3 third argument of the format
477 * \param a4 fourth argument of the format
478 * \param a5 fifth argument of the format
479 * \param a6 sixth argument of the format
481 * The macros INFO0 ... INFO5 naturally also exist, but are not listed here
482 * for sake of clarity. They just differ in the number of arguments passed
483 * along with the format string.
486 #define INFO0(f) LOG0(xbt_log_priority_info, f)
487 #define INFO1(f,a1) LOG1(xbt_log_priority_info, f,a1)
488 #define INFO2(f,a1,a2) LOG2(xbt_log_priority_info, f,a1,a2)
489 #define INFO3(f,a1,a2,a3) LOG3(xbt_log_priority_info, f,a1,a2,a3)
490 #define INFO4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_info, f,a1,a2,a3,a4)
491 #define INFO5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_info, f,a1,a2,a3,a4,a5)
492 #define INFO6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
497 * Log something to the current default category under the warning priority.
498 * \param f the format string
499 * \param a1 first argument of the format
500 * \param a2 second argument of the format
501 * \param a3 third argument of the format
502 * \param a4 fourth argument of the format
503 * \param a5 fifth argument of the format
504 * \param a6 sixth argument of the format
506 * The macros WARN0 ... WARN5 naturally also exist, but are not listed here
507 * for sake of clarity. They just differ in the number of arguments passed
508 * along with the format string.
511 #define WARN0(f) LOG0(xbt_log_priority_warning, f)
512 #define WARN1(f,a1) LOG1(xbt_log_priority_warning, f,a1)
513 #define WARN2(f,a1,a2) LOG2(xbt_log_priority_warning, f,a1,a2)
514 #define WARN3(f,a1,a2,a3) LOG3(xbt_log_priority_warning, f,a1,a2,a3)
515 #define WARN4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_warning, f,a1,a2,a3,a4)
516 #define WARN5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
517 #define WARN6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
522 * Log something to the current default category under the error priority.
523 * \param f the format string
524 * \param a1 first argument of the format
525 * \param a2 second argument of the format
526 * \param a3 third argument of the format
527 * \param a4 fourth argument of the format
528 * \param a5 fifth argument of the format
529 * \param a6 sixth argument of the format
531 * The macros ERROR0 ... ERROR5 naturally also exist, but are not listed here
532 * for sake of clarity. They just differ in the number of arguments passed
533 * along with the format string.
536 #define ERROR0(f) LOG0(xbt_log_priority_error, f)
537 #define ERROR1(f,a1) LOG1(xbt_log_priority_error, f,a1)
538 #define ERROR2(f,a1,a2) LOG2(xbt_log_priority_error, f,a1,a2)
539 #define ERROR3(f,a1,a2,a3) LOG3(xbt_log_priority_error, f,a1,a2,a3)
540 #define ERROR4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_error, f,a1,a2,a3,a4)
541 #define ERROR5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_error, f,a1,a2,a3,a4,a5)
542 #define ERROR6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
547 * Log something to the current default category under the critical priority.
548 * \param f the format string
549 * \param a1 first argument of the format
550 * \param a2 second argument of the format
551 * \param a3 third argument of the format
552 * \param a4 fourth argument of the format
553 * \param a5 fifth argument of the format
554 * \param a6 sixth argument of the format
556 * The macros CRITICAL0 ... CRITICAL5 naturally also exist, but are not listed here
557 * for sake of clarity. They just differ in the number of arguments passed
558 * along with the format string.
561 #define CRITICAL0(f) LOG0(xbt_log_priority_critical, f)
562 #define CRITICAL1(f,a1) LOG1(xbt_log_priority_critical, f,a1)
563 #define CRITICAL2(f,a1,a2) LOG2(xbt_log_priority_critical, f,a1,a2)
564 #define CRITICAL3(f,a1,a2,a3) LOG3(xbt_log_priority_critical, f,a1,a2,a3)
565 #define CRITICAL4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_critical, f,a1,a2,a3,a4)
566 #define CRITICAL5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
567 #define CRITICAL6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
570 #define XBT_IN LOG1(xbt_log_priority_trace, ">> begin of %s", _XBT_FUNCTION)
571 #define XBT_IN1(fmt,a) LOG2(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a)
572 #define XBT_IN2(fmt,a,b) LOG3(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b)
573 #define XBT_IN3(fmt,a,b,c) LOG4(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c)
574 #define XBT_IN4(fmt,a,b,c,d) LOG5(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d)
575 #define XBT_OUT LOG1(xbt_log_priority_trace, "<< end of %s", _XBT_FUNCTION)
576 #define XBT_HERE LOG0(xbt_log_priority_trace, "-- was here")
578 #endif /* ! _XBT_LOG_H_ */