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)
16 /** \defgroup XBT_log_cats Existing log categories
18 * \brief (automatically extracted)
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.
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 ;)
29 /* XBT_LOG_MAYDAY: define this to replace the logging facilities with basic
30 printf function. Useful to debug the logging facilities themselves */
32 /*#define XBT_LOG_MAYDAY*/
41 /**\brief Log priorities
44 * The different existing priorities.
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 */
56 xbt_log_priority_infinite = 8, /**< value for XBT_LOG_STATIC_THRESHOLD to not log */
58 xbt_log_priority_uninitialized = -1 /* used internally (don't poke with) */
59 } e_xbt_log_priority_t;
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
69 * @def XBT_LOG_STATIC_THRESHOLD
72 * All logging requests with priority < XBT_LOG_STATIC_THRESHOLD are disabled at
73 * compile time, i.e., compiled out.
76 # define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_infinite
80 # define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_verbose
81 # else /* !NLOG && !NDEBUG */
83 # ifndef XBT_LOG_STATIC_THRESHOLD
84 # define XBT_LOG_STATIC_THRESHOLD xbt_log_priority_none
85 # endif /* !XBT_LOG_STATIC_THRESHOLD */
87 #endif /* !defined(NLOG) */
89 /* Transforms a category name to a global variable name. */
90 #define _XBT_LOGV(cat) _XBT_LOG_CONCAT(_gras_this_log_category_does_not_exist__, cat)
91 #define _XBT_LOG_CONCAT(x,y) x ## y
93 /* The root of the category hierarchy. */
94 #define XBT_LOG_ROOT_CAT root
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 s_xbt_log_category_t _XBT_LOGV(catName) = { \
102 &_XBT_LOGV(parent), 0, 0, \
103 #catName, xbt_log_priority_uninitialized, 1, \
108 * \param catName name of new category
109 * \param parent father of the new category in the tree
110 * \param desc string describing the purpose of this category
113 * Defines a new subcategory of the parent.
115 #define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc) \
116 extern s_xbt_log_category_t _XBT_LOGV(parent); \
117 XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
121 * \param catName name of new category
122 * \param desc string describing the purpose of this category
125 * Creates a new subcategory of the root category.
127 #define XBT_LOG_NEW_CATEGORY(catName,desc) XBT_LOG_NEW_SUBCATEGORY_helper(catName, XBT_LOG_ROOT_CAT, desc)
131 * \param cname name of the cat
134 * Indicates which category is the default one.
137 #if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
138 # define XBT_LOG_DEFAULT_CATEGORY(cname)
140 # define XBT_LOG_DEFAULT_CATEGORY(cname) \
141 static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname)
146 * \param cname name of the cat
147 * \param desc string describing the purpose of this category
150 * Creates a new subcategory of the root category and makes it the default
151 * (used by macros that don't explicitly specify a category).
153 #define XBT_LOG_NEW_DEFAULT_CATEGORY(cname,desc) \
154 XBT_LOG_NEW_CATEGORY(cname,desc); \
155 XBT_LOG_DEFAULT_CATEGORY(cname)
159 * \param cname name of the cat
160 * \param parent name of the parent
161 * \param desc string describing the purpose of this category
164 * Creates a new subcategory of the parent category and makes it the default
165 * (used by macros that don't explicitly specify a category).
167 #define XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent, desc) \
168 XBT_LOG_NEW_SUBCATEGORY(cname, parent, desc); \
169 XBT_LOG_DEFAULT_CATEGORY(cname)
173 * \param cname name of the cat
176 * Indicates that a category you'll use in this file (to get subcategories of it,
177 * for example) really lives in another file.
180 #define XBT_LOG_EXTERNAL_CATEGORY(cname) \
181 extern s_xbt_log_category_t _XBT_LOGV(cname)
183 /* Functions you may call */
185 extern void xbt_log_control_set(const char* cs);
187 /* Forward declarations */
188 typedef struct xbt_log_appender_s s_xbt_log_appender_t,*xbt_log_appender_t;
189 typedef struct xbt_log_event_s s_xbt_log_event_t, *xbt_log_event_t;
190 typedef struct xbt_log_category_s s_xbt_log_category_t,*xbt_log_category_t;
193 * Do NOT access any members of this structure directly. FIXME: move to private?
195 struct xbt_log_category_s {
196 xbt_log_category_t parent;
197 /*@null@*/ xbt_log_category_t firstChild;
198 /*@null@*/ xbt_log_category_t nextSibling;
201 int isThreshInherited;
202 /*@null@*/ xbt_log_appender_t appender;
207 struct xbt_log_appender_s {
208 void (*do_append) (xbt_log_appender_t thisLogAppender,
209 xbt_log_event_t event, const char *fmt);
213 struct xbt_log_event_s {
214 xbt_log_category_t cat;
215 e_xbt_log_priority_t priority;
216 const char* fileName;
217 const char* functionName;
223 * \ingroup XBT_log_implem
224 * \param cat the category (not only its name, but the variable)
225 * \param thresholdPriority the priority
227 * Programatically alters a category's threshold priority (don't use).
229 extern void xbt_log_threshold_set(xbt_log_category_t cat,
230 e_xbt_log_priority_t thresholdPriority);
233 * \ingroup XBT_log_implem
234 * \param cat the category (not only its name, but the variable)
235 * \param parent the parent cat
237 * Programatically alter a category's parent (don't use).
239 extern void xbt_log_parent_set(xbt_log_category_t cat,
240 xbt_log_category_t parent);
243 * \ingroup XBT_log_implem
244 * \param cat the category (not only its name, but the variable)
245 * \param app the appender
247 * Programatically sets the category's appender (don't use).
249 extern void xbt_log_appender_set(xbt_log_category_t cat,
250 xbt_log_appender_t app);
252 /* Functions that you shouldn't call. */
253 extern void _xbt_log_event_log(xbt_log_event_t ev,
255 ...) _XBT_GNUC_PRINTF(2,3);
257 extern int _xbt_log_cat_init(e_xbt_log_priority_t priority,
258 xbt_log_category_t category);
261 extern s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT);
262 XBT_LOG_EXTERNAL_CATEGORY(GRAS);
263 extern xbt_log_appender_t xbt_log_default_appender;
267 * \param catName name of the category
268 * \param priority minimal priority to be enabled to return true
271 * Returns true if the given priority is enabled for the category.
272 * If you have expensive expressions that are computed outside of the log
273 * command and used only within it, you should make its evaluation conditional
276 #define XBT_LOG_ISENABLED(catName, priority) \
277 _XBT_LOG_ISENABLEDV(_XBT_LOGV(catName), priority)
280 * Helper function that implements XBT_LOG_ISENABLED.
283 * First part is a compile-time constant.
284 * Call to _log_initCat only happens once.
286 #define _XBT_LOG_ISENABLEDV(catv, priority) \
287 (priority >= XBT_LOG_STATIC_THRESHOLD \
288 && priority >= catv.threshold \
289 && (catv.threshold != xbt_log_priority_uninitialized \
290 || _xbt_log_cat_init(priority, &catv)) )
294 * Some kludge macros to ease maintenance. See how they're used below.
296 * IMPLEMENTATION NOTE: To reduce the parameter passing overhead of an enabled
297 * message, the many parameters passed to the logging function are packed in a
298 * structure. Since these values will be usually be passed to at least 3
299 * functions, this is a win.
300 * It also allows adding new values (such as a timestamp) without breaking
302 * Setting the LogEvent's valist member is done inside _log_logEvent.
305 #define _XBT_LOG_PRE(catv, priority) do { \
306 if (_XBT_LOG_ISENABLEDV(catv, priority)) { \
307 s_xbt_log_event_t _log_ev = \
308 {&(catv),priority,__FILE__,_XBT_FUNCTION,__LINE__}; \
309 _xbt_log_event_log(&_log_ev
311 #define _XBT_LOG_POST \
318 #ifdef XBT_LOG_MAYDAY
319 # define CLOG0(c, p, f) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__)
320 # define CLOG1(c, p, f,a1) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1)
321 # define CLOG2(c, p, f,a1,a2) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2)
322 # define CLOG3(c, p, f,a1,a2,a3) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3)
323 # define CLOG4(c, p, f,a1,a2,a3,a4) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4)
324 # define CLOG5(c, p, f,a1,a2,a3,a4,a5) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5)
325 # 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)
326 # 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)
327 # 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)
329 # define CLOG0(c, p, f) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f _XBT_LOG_POST
330 # define CLOG1(c, p, f,a1) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1 _XBT_LOG_POST
331 # define CLOG2(c, p, f,a1,a2) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2 _XBT_LOG_POST
332 # define CLOG3(c, p, f,a1,a2,a3) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3 _XBT_LOG_POST
333 # define CLOG4(c, p, f,a1,a2,a3,a4) _XBT_LOG_PRE(_XBT_LOGV(c),p) ,f,a1,a2,a3,a4 _XBT_LOG_POST
334 # 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
335 # 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
336 # 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
337 # 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
340 #define CDEBUG0(c, f) CLOG0(c, xbt_log_priority_debug, f)
341 #define CDEBUG1(c, f,a1) CLOG1(c, xbt_log_priority_debug, f,a1)
342 #define CDEBUG2(c, f,a1,a2) CLOG2(c, xbt_log_priority_debug, f,a1,a2)
343 #define CDEBUG3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_debug, f,a1,a2,a3)
344 #define CDEBUG4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_debug, f,a1,a2,a3,a4)
345 #define CDEBUG5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5)
346 #define CDEBUG6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
347 #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)
348 #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)
350 #define CVERB0(c, f) CLOG0(c, xbt_log_priority_verbose, f)
351 #define CVERB1(c, f,a1) CLOG1(c, xbt_log_priority_verbose, f,a1)
352 #define CVERB2(c, f,a1,a2) CLOG2(c, xbt_log_priority_verbose, f,a1,a2)
353 #define CVERB3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_verbose, f,a1,a2,a3)
354 #define CVERB4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_verbose, f,a1,a2,a3,a4)
355 #define CVERB5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
356 #define CVERB6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
358 #define CINFO0(c, f) CLOG0(c, xbt_log_priority_info, f)
359 #define CINFO1(c, f,a1) CLOG1(c, xbt_log_priority_info, f,a1)
360 #define CINFO2(c, f,a1,a2) CLOG2(c, xbt_log_priority_info, f,a1,a2)
361 #define CINFO3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_info, f,a1,a2,a3)
362 #define CINFO4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_info, f,a1,a2,a3,a4)
363 #define CINFO5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5)
364 #define CINFO6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
365 #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)
366 #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)
368 #define CWARN0(c, f) CLOG0(c, xbt_log_priority_warning, f)
369 #define CWARN1(c, f,a1) CLOG1(c, xbt_log_priority_warning, f,a1)
370 #define CWARN2(c, f,a1,a2) CLOG2(c, xbt_log_priority_warning, f,a1,a2)
371 #define CWARN3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_warning, f,a1,a2,a3)
372 #define CWARN4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_warning, f,a1,a2,a3,a4)
373 #define CWARN5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
374 #define CWARN6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
376 #define CERROR0(c, f) CLOG0(c, xbt_log_priority_error, f)
377 #define CERROR1(c, f,a1) CLOG1(c, xbt_log_priority_error, f,a1)
378 #define CERROR2(c, f,a1,a2) CLOG2(c, xbt_log_priority_error, f,a1,a2)
379 #define CERROR3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_error, f,a1,a2,a3)
380 #define CERROR4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_error, f,a1,a2,a3,a4)
381 #define CERROR5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5)
382 #define CERROR6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
384 #define CCRITICAL0(c, f) CLOG0(c, xbt_log_priority_critical, f)
385 #define CCRITICAL1(c, f,a1) CLOG1(c, xbt_log_priority_critical, f,a1)
386 #define CCRITICAL2(c, f,a1,a2) CLOG2(c, xbt_log_priority_critical, f,a1,a2)
387 #define CCRITICAL3(c, f,a1,a2,a3) CLOG3(c, xbt_log_priority_critical, f,a1,a2,a3)
388 #define CCRITICAL4(c, f,a1,a2,a3,a4) CLOG4(c, xbt_log_priority_critical, f,a1,a2,a3,a4)
389 #define CCRITICAL5(c, f,a1,a2,a3,a4,a5) CLOG5(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
390 #define CCRITICAL6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
392 #ifdef XBT_LOG_MAYDAY
393 # define LOG0(p, f) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__)
394 # define LOG1(p, f,a1) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1)
395 # define LOG2(p, f,a1,a2) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2)
396 # define LOG3(p, f,a1,a2,a3) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3)
397 # define LOG4(p, f,a1,a2,a3,a4) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4)
398 # define LOG5(p, f,a1,a2,a3,a4,a5) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5)
399 # define LOG6(p, f,a1,a2,a3,a4,a5,a6) fprintf(stderr,"%s:%d:" f "\n",__FILE__,__LINE__,a1,a2,a3,a4,a5,a6)
400 # 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)
401 # 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)
403 # define LOG0(p, f) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f _XBT_LOG_POST
404 # define LOG1(p, f,a1) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1 _XBT_LOG_POST
405 # define LOG2(p, f,a1,a2) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2 _XBT_LOG_POST
406 # define LOG3(p, f,a1,a2,a3) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3 _XBT_LOG_POST
407 # define LOG4(p, f,a1,a2,a3,a4) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4 _XBT_LOG_POST
408 # 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
409 # 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
410 # 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
411 # 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
416 * Log something to the current default category under the debug priority.
417 * \param f the format string
418 * \param a1 first argument of the format
419 * \param a2 second argument of the format
420 * \param a3 third argument of the format
421 * \param a4 fourth argument of the format
422 * \param a5 fifth argument of the format
423 * \param a6 sixth argument of the format
425 * The macros DEBUG0 ... DEBUG5 naturally also exist, but are not listed here
426 * for sake of clarity. They just differ in the number of arguments passed
427 * along with the format string.
430 #define DEBUG0(f) LOG0(xbt_log_priority_debug, f)
431 #define DEBUG1(f,a1) LOG1(xbt_log_priority_debug, f,a1)
432 #define DEBUG2(f,a1,a2) LOG2(xbt_log_priority_debug, f,a1,a2)
433 #define DEBUG3(f,a1,a2,a3) LOG3(xbt_log_priority_debug, f,a1,a2,a3)
434 #define DEBUG4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_debug, f,a1,a2,a3,a4)
435 #define DEBUG5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_debug, f,a1,a2,a3,a4,a5)
436 #define DEBUG6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
437 #define DEBUG7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7)
438 #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)
443 * Log something to the current default category under the verbose priority.
444 * \param f the format string
445 * \param a1 first argument of the format
446 * \param a2 second argument of the format
447 * \param a3 third argument of the format
448 * \param a4 fourth argument of the format
449 * \param a5 fifth argument of the format
450 * \param a6 sixth argument of the format
452 * The macros VERB0 ... VERB5 naturally also exist, but are not listed here
453 * for sake of clarity. They just differ in the number of arguments passed
454 * along with the format string.
457 #define VERB0(f) LOG0(xbt_log_priority_verbose, f)
458 #define VERB1(f,a1) LOG1(xbt_log_priority_verbose, f,a1)
459 #define VERB2(f,a1,a2) LOG2(xbt_log_priority_verbose, f,a1,a2)
460 #define VERB3(f,a1,a2,a3) LOG3(xbt_log_priority_verbose, f,a1,a2,a3)
461 #define VERB4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_verbose, f,a1,a2,a3,a4)
462 #define VERB5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
463 #define VERB6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
468 * Log something to the current default category under the info priority.
469 * \param f the format string
470 * \param a1 first argument of the format
471 * \param a2 second argument of the format
472 * \param a3 third argument of the format
473 * \param a4 fourth argument of the format
474 * \param a5 fifth argument of the format
475 * \param a6 sixth argument of the format
477 * The macros INFO0 ... INFO5 naturally also exist, but are not listed here
478 * for sake of clarity. They just differ in the number of arguments passed
479 * along with the format string.
482 #define INFO0(f) LOG0(xbt_log_priority_info, f)
483 #define INFO1(f,a1) LOG1(xbt_log_priority_info, f,a1)
484 #define INFO2(f,a1,a2) LOG2(xbt_log_priority_info, f,a1,a2)
485 #define INFO3(f,a1,a2,a3) LOG3(xbt_log_priority_info, f,a1,a2,a3)
486 #define INFO4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_info, f,a1,a2,a3,a4)
487 #define INFO5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_info, f,a1,a2,a3,a4,a5)
488 #define INFO6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
489 #define INFO7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6,a7)
490 #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)
495 * Log something to the current default category under the warning priority.
496 * \param f the format string
497 * \param a1 first argument of the format
498 * \param a2 second argument of the format
499 * \param a3 third argument of the format
500 * \param a4 fourth argument of the format
501 * \param a5 fifth argument of the format
502 * \param a6 sixth argument of the format
504 * The macros WARN0 ... WARN5 naturally also exist, but are not listed here
505 * for sake of clarity. They just differ in the number of arguments passed
506 * along with the format string.
509 #define WARN0(f) LOG0(xbt_log_priority_warning, f)
510 #define WARN1(f,a1) LOG1(xbt_log_priority_warning, f,a1)
511 #define WARN2(f,a1,a2) LOG2(xbt_log_priority_warning, f,a1,a2)
512 #define WARN3(f,a1,a2,a3) LOG3(xbt_log_priority_warning, f,a1,a2,a3)
513 #define WARN4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_warning, f,a1,a2,a3,a4)
514 #define WARN5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
515 #define WARN6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
520 * Log something to the current default category under the error priority.
521 * \param f the format string
522 * \param a1 first argument of the format
523 * \param a2 second argument of the format
524 * \param a3 third argument of the format
525 * \param a4 fourth argument of the format
526 * \param a5 fifth argument of the format
527 * \param a6 sixth argument of the format
529 * The macros ERROR0 ... ERROR5 naturally also exist, but are not listed here
530 * for sake of clarity. They just differ in the number of arguments passed
531 * along with the format string.
534 #define ERROR0(f) LOG0(xbt_log_priority_error, f)
535 #define ERROR1(f,a1) LOG1(xbt_log_priority_error, f,a1)
536 #define ERROR2(f,a1,a2) LOG2(xbt_log_priority_error, f,a1,a2)
537 #define ERROR3(f,a1,a2,a3) LOG3(xbt_log_priority_error, f,a1,a2,a3)
538 #define ERROR4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_error, f,a1,a2,a3,a4)
539 #define ERROR5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_error, f,a1,a2,a3,a4,a5)
540 #define ERROR6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
545 * Log something to the current default category under the critical priority.
546 * \param f the format string
547 * \param a1 first argument of the format
548 * \param a2 second argument of the format
549 * \param a3 third argument of the format
550 * \param a4 fourth argument of the format
551 * \param a5 fifth argument of the format
552 * \param a6 sixth argument of the format
554 * The macros CRITICAL0 ... CRITICAL5 naturally also exist, but are not listed here
555 * for sake of clarity. They just differ in the number of arguments passed
556 * along with the format string.
559 #define CRITICAL0(f) LOG0(xbt_log_priority_critical, f)
560 #define CRITICAL1(f,a1) LOG1(xbt_log_priority_critical, f,a1)
561 #define CRITICAL2(f,a1,a2) LOG2(xbt_log_priority_critical, f,a1,a2)
562 #define CRITICAL3(f,a1,a2,a3) LOG3(xbt_log_priority_critical, f,a1,a2,a3)
563 #define CRITICAL4(f,a1,a2,a3,a4) LOG4(xbt_log_priority_critical, f,a1,a2,a3,a4)
564 #define CRITICAL5(f,a1,a2,a3,a4,a5) LOG5(xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
565 #define CRITICAL6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
568 #define XBT_IN LOG1(xbt_log_priority_trace, ">> begin of %s", _XBT_FUNCTION)
569 #define XBT_IN1(fmt,a) LOG2(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a)
570 #define XBT_IN2(fmt,a,b) LOG3(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b)
571 #define XBT_IN3(fmt,a,b,c) LOG4(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c)
572 #define XBT_IN4(fmt,a,b,c,d) LOG5(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d)
573 #define XBT_OUT LOG1(xbt_log_priority_trace, "<< end of %s", _XBT_FUNCTION)
574 #define XBT_HERE LOG0(xbt_log_priority_trace, "-- was here")
576 #endif /* ! _XBT_LOG_H_ */