log4c.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001, Bit Farm, Inc. All rights reserved.
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  * 1. Redistributions of source code must retain the above copyright
00008  *    notice, this list of conditions and the following disclaimer.
00009  * 2. Redistributions in binary form must reproduce the above copyright
00010  *    notice, this list of conditions and the following disclaimer in the
00011  *    documentation and/or other materials provided with the distribution.
00012  * 3. The name of the author may not be used to endorse or promote products
00013  *    derived from this software without specific prior written permission.
00014  * 
00015  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00016  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00017  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00018  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00019  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00020  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00021  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00022  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00024  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025  */
00026 
00027 /* Modified slightly for Race into Space project. */
00028 
00029 /**
00030  * @file log4c.h
00031  * An easy-to-use, fast and flexible message logging architecture.
00032  *
00033  * This is loosely based on the Apache project's  Log4J, Log4CC,
00034  * etc. project. Because C is not object oriented, a lot had to change.
00035  *
00036  * The following documentation is a hacked version of the Log4J docs.
00037  *
00038  * OVERVIEW
00039  *
00040  * Log4C has 3 main concepts: category, priority and appender.
00041  * These three concepts work together to enable developers to log messages
00042  * according to message type and priority, and to control at runtime how these
00043  * messages are formatted and where they are reported.
00044  *
00045  * CATEGORY HIERARCHY
00046  *
00047  * The first and foremost advantage of any logging API over plain printf()
00048  * resides in its ability to disable certain log statements while allowing
00049  * others to print unhindered. This capability assumes that the logging space,
00050  * that is, the space of all possible logging statements, is categorized
00051  * according to some developer-chosen criteria.  
00052  *
00053  * This observation led to choosing category as the central concept of the
00054  * system. Every category is declared by providing a name and an optional
00055  * parent. If no parent is explicitly named, the root category, LOG_ROOT_CAT is
00056  * the category's parent.
00057  *
00058  * A category is created by a macro call at the top level of a file.
00059  * A category can be created with any one of the following macros:
00060  *
00061  *      - LOG_NEW_CATEGORY(MyCat);
00062  *      - LOG_NEW_SUBCATEGORY(MyCat, ParentCat);
00063  *      - LOG_NEW_DEFAULT_CATEGORY(MyCat);
00064  *      - LOG_NEW_DEFAULT_SUBCATEGORY(MyCat, ParentCat);
00065  *
00066  * The parent cat can be defined in the same file or in another file, but each
00067  * category may have only one definition.
00068  *
00069  * Typically, there will be a Category for each module and sub-module, so you
00070  * can independently control logging for each module.
00071  *
00072  * PRIORITY
00073  *
00074  * A category may be assigned a threshold priorty. The set of priorites are
00075  * defined by symbolic constants: LP_TRACE, LP_DEBUG, LP_INFO,
00076  * LP_NOTICE, LP_WARNING , LP_ERROR, LP_CRITICAL, LP_ALERT, and LP_EMERGENCY.
00077  * The priorities are simply non-negative integers. [It is possible to use your
00078  * own set by supplying a custom appender.]
00079  *
00080  * If a given category is not assigned a threshold priority, then it inherits
00081  * one from its closest ancestor with an assigned threshold.
00082  *
00083  * To ensure that all categories can eventually inherit a threshold, the root
00084  * category always has an assigned threshold priority.
00085  *
00086  * Logging requests are made by invoking a logging macro on a category.
00087  * All of the macros have a printf-style format string followed by arguments. 
00088  * Because most C compilers do not support vararg macros, there is a version of
00089  * the macro for any number of arguments from 0 to 6. The macro name ends with
00090  * the total number of arguments.
00091  *
00092  * Here is an example of the most basic type of macro:
00093  *
00094  * <code>
00095  *      CLOG5(MyCat, LP_WARN, "Values are: %d and '%s'", 5, "oops");
00096  * </code>
00097  *
00098  * This is a logging request with priority WARN.
00099  *
00100  * A logging request is said to be enabled if its priority is higher than or
00101  * equal to the threshold priority of its category. Otherwise, the request is
00102  * said to be disabled. A category without an assigned priority will inherit
00103  * one from the hierarchy.
00104  *
00105  * It is possible to use any non-negative integer as a priority. If, as in the
00106  * example, one of the standard priorites is used, then there is a convenience
00107  * macro that is typically used instead. For example, the above example is
00108  * equivalent to the shorter:
00109  *
00110  * <code>
00111  *      CWARN4(MyCat, "Values are: %d and '%s'", 5, "oops");
00112  * </code>
00113  *
00114  * DEFAULT CATEGORY
00115  *
00116  * If LOG_NEW_DEFAULT_SUBCATEGORY(MyCat, Parent) or
00117  * LOG_NEW_DEFAULT_CATEGORY(MyCat) is used to create the category, then the
00118  * even shorter form can be used:
00119  *
00120  * <code>
00121  *      WARN3("Values are: %d and '%s'", 5, "oops");
00122  * </code>
00123  *
00124  * Only one default category can be created per file, though multiple
00125  * non-defaults can be created and used.
00126  *
00127  * EXAMPLE
00128  *
00129  * Here is a more complete example:
00130  *
00131  * @code
00132  *      #include "log4c.h"
00133  *
00134  *      // create a category and a default subcategory
00135  *      LOG_NEW_CATEGORY(VSS);
00136  *      LOG_NEW_DEFAULT_SUBCATEGORY(SA, VSS);
00137  *
00138  *      main() {
00139  *             // Now set the parent's priority.
00140  *             // (the string would typcially be a runtime option)
00141  *             log_setControlString("SA.thresh=3");
00142  *
00143  *             // This request is enabled, because WARNING >= INFO.
00144  *             CWARN2(VSS, "Low fuel level.");
00145  *
00146  *             // This request is disabled, because DEBUG < INFO.
00147  *             CDEBUG2(VSS, "Starting search for nearest gas station."); 
00148  *
00149  *             // The default category SA inherits its priority from VSS. Thus,
00150  *             // the following request is enabled because INFO >= INFO.  
00151  *             INFO1("Located nearest gas station.");
00152  *
00153  *             // This request is disabled, because DEBUG < INFO.
00154  *             DEBUG1("Exiting gas station search");
00155  *       }
00156  * @endcode
00157  *
00158  * PERFORMANCE
00159  *
00160  * Clever design insures efficiency. Except for the first invocation, a
00161  * disabled logging request requires an a single comparison of a static
00162  * variable to a constant.
00163  *
00164  * There is also compile time constant, LOG_STATIC_THRESHOLD, which causes all
00165  * logging requests with a lower priority to be optimized to 0 cost by the
00166  * compiler. By setting it to LP_INFINITE, all logging requests are statically
00167  * disabled and cost nothing. Released executables might typically be compiled
00168  * with "-DLOG_STATIC_THRESHOLD=LP_INFO"
00169  *
00170  * APPENDERS
00171  *
00172  * Each category has an optional appender. An appender is a pointer to a
00173  * structure whcih starts with a pointer to a doAppend() function. DoAppend()
00174  * prints a message to a log.
00175  *
00176  * WHen a category is passed a message by one of the logging macros, the
00177  * category performs the following actions:
00178  * 
00179  * 1. if the category has an appender, the message is passed to the appender's
00180  *    doAppend() function,
00181  *
00182  * 2. if 'willLogToParent' is true for the category,  the message is passed to
00183  * the category's parent.
00184  *
00185  * By default, all categories except root have no appender and
00186  * 'willLogToParent' is true. This situation causes all messages to be logged
00187  * by the root category's appender.
00188  *
00189  * Typically, you would only change the root category's appender when you
00190  * wanted, say, a different output format. Copying log_default.c would
00191  * be a good start.
00192  *
00193  * The default appender function currently prints to stderr.
00194  *
00195  * MISC
00196  *
00197  * Do not use any of the macros that start with '_'.
00198  *
00199  * CAVEATS
00200  *
00201  * Category names are global variables.
00202  */
00203 #ifndef _LOG4C_H_
00204 #define _LOG4C_H_
00205 
00206 #include "race.h"
00207 #include <stdarg.h>
00208 
00209 /**
00210  * @name Priority Values
00211  *
00212  * These are the same names (except TRACE is new) as used by Unix syslog(), but
00213  * the numerical values are different.
00214  *@{
00215  */
00216 
00217 #define LP_NONE           0
00218 #define LP_TRACE          1
00219 #define LP_DEBUG          2
00220 #define LP_INFO           3
00221 #define LP_NOTICE         4
00222 #define LP_WARNING        5
00223 #define LP_ERROR          6
00224 #define LP_CRITICAL       7
00225 #define LP_ALERT          8
00226 #define LP_EMERGENCY      9
00227 
00228 #define LP_UNINITIALIZED  -1    ///< for internal use only
00229 
00230 #ifndef LOG_STATIC_THRESHOLD
00231 /**
00232  * All logging with priority < LOG_STATIC_THRESHOLD is disabled at compile
00233  * time, i.e., compiled out.
00234  */
00235   #define LOG_STATIC_THRESHOLD LP_NONE
00236 #endif
00237 
00238 /*@}*/
00239 
00240 /** Transforms a category name to a global variable name. */
00241 #define _LOGV(cat)   _LOG_CONCAT(_log_c, cat)
00242 #define _LOG_CONCAT(x,y) x ## _ ## y
00243 
00244 /** The root of the category hierarchy. */
00245 #ifndef LOG_ROOT_CAT
00246 #define LOG_ROOT_CAT   root
00247 #endif
00248 
00249 /** Defines a new subcategory of the parent. */
00250 #define LOG_NEW_SUBCATEGORY(catName, parent)    \
00251     extern struct LogCategory _LOGV(parent);    \
00252     struct LogCategory _LOGV(catName) = {       \
00253         &_LOGV(parent), 0, 0,                   \
00254         #catName, LP_UNINITIALIZED, 1,          \
00255         0, 1                                    \
00256     };
00257 
00258 /**
00259  * Creates a new subcategory of the root category.
00260  */
00261 #define LOG_NEW_CATEGORY(catName)  LOG_NEW_SUBCATEGORY(catName, LOG_ROOT_CAT)
00262 
00263 /**
00264  * Exports category (use this one in header files)
00265  */
00266 #define LOG_EXPORT_CATEGORY(catName)  extern struct LogCategory _LOGV(catName)
00267 
00268 /**
00269  * Creates a new subcategory of the root category.
00270  */
00271 
00272 #define LOG_DEFAULT_CATEGORY(cname) \
00273     static struct LogCategory* _log_defaultCategory = &_LOGV(cname);
00274 
00275 /**
00276  * Creates a new subcategory of the root category and makes it the default
00277  * (used by macros that don't explicitly specify a category).
00278  */
00279 #define LOG_NEW_DEFAULT_CATEGORY(cname)         \
00280     LOG_NEW_CATEGORY(cname);                    \
00281     LOG_DEFAULT_CATEGORY(cname);
00282 
00283 /**
00284  * Creates a new subcategory of the parent category and makes it the default
00285  * (used by macros that don't explicitly specify a category).
00286  */
00287 #define LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent)      \
00288     LOG_NEW_SUBCATEGORY(cname, parent);                 \
00289     LOG_DEFAULT_CATEGORY(cname);
00290 
00291 // Functions you may call
00292 
00293 #if 0
00294 /**
00295  * Typically passed a command-line argument. The string has the syntax:
00296  *
00297  *      ( <category> "." <keyword> "=" value (" ")... )...
00298  *
00299  * where <category> is one the category names and keyword is one of the
00300  * following:
00301  *
00302  *      thresh      value is an integer priority level. Sets the category's
00303  *                        threshold priority.
00304  *
00305  * @warning
00306  * This routine may only be called once and that must be before any other
00307  * logging command! Typically, this is done from main().
00308  *
00309  * @todo should allow symbolic priority values.
00310  */
00311 extern const char* log_setControlString(const char* cs);
00312 #endif
00313 
00314 // Forward declarations
00315 struct LogAppender;
00316 struct LogEvent;
00317 
00318 /**
00319  * Do NOT access any members of this structure directly.
00320  */
00321 struct LogCategory {
00322     struct LogCategory *parent;
00323     struct LogCategory *firstChild, *nextSibling;
00324     char *name;
00325     int thresholdPriority;
00326     int isThreshInherited;
00327     struct LogAppender *appender;
00328     int willLogToParent;
00329     // TODO: Formats?
00330 };
00331 
00332 struct LogAppender {
00333     void (*doAppend) (struct LogAppender* thisLogAppender,
00334                       struct LogEvent* event);
00335 };
00336 
00337 struct LogEvent {
00338     struct LogCategory* cat;
00339     int priority;
00340     char* fileName;
00341     char* functionName;
00342     int lineNum;
00343     char *fmt;
00344     va_list ap;
00345 };
00346 
00347 /**
00348  * Programatically alters a category's threshold priority.
00349  */
00350 extern void log_setThreshold(struct LogCategory* cat, int thresholdPriority);
00351 
00352 /**
00353  * Programatically alter a category's parent.
00354  */
00355 extern void log_setParent(struct LogCategory* cat, struct LogCategory* parent);
00356 
00357 /**
00358  * Sets the category's appender.
00359  */
00360 extern void log_setAppender(struct LogCategory* cat, struct LogAppender* app);
00361 
00362 // Functions that you shouldn't call. 
00363 extern void _log_logEvent(struct LogCategory* category,
00364                           struct LogEvent*ev,...);
00365 extern int _log_initCat(int priority, struct LogCategory* category);
00366 
00367 extern struct LogCategory _LOGV(LOG_ROOT_CAT);
00368 extern struct LogAppender *log_defaultLogAppender;
00369 
00370 /**
00371  * Returns true if the given priority is enabled for the category.
00372  * If you have expensive expressions that are computed outside of the log
00373  * command and used only within it, you should make its evaluation conditional
00374  * using this macro.
00375  */
00376 #define LOG_ISENABLED(catName, priority) \
00377             _LOG_ISENABLEDV(_LOGV(catName), priority)
00378 
00379 /**
00380  * Helper function that implements LOG_ISENABLED.
00381  *
00382  * NOTES
00383  * First part is a compile-time constant.
00384  * Call to _log_initCat only happens once.
00385  */
00386 #define _LOG_ISENABLEDV(catv, priority)                         \
00387        (priority >= LOG_STATIC_THRESHOLD                        \
00388         && priority >= (catv).thresholdPriority                 \
00389         && ((catv).thresholdPriority != LP_UNINITIALIZED        \
00390             || _log_initCat(priority, &(catv))) )
00391 
00392 /**
00393  * @name Internal Macros
00394  * Some kludge macros to ease maintenance. See how they're used below.
00395  *
00396  * IMPLEMENTATION NOTE: To reduce the parameter passing overhead of an enabled
00397  * message, the many parameters passed to the logging function are packed in a
00398  * structure. Since these values will be usually be passed to at least 3
00399  * functions, this is a win.
00400  * It also allows adding new values (such as a timestamp) without breaking
00401  * code. 
00402  * Setting the LogEvent's valist member is done inside _log_logEvent.
00403  * UPDATE: we set va_list to 0 to shut up the compiler.
00404  */
00405 //@{
00406 #define _LOG_PRE(catv, priority, fmt) do {                              \
00407      if (_LOG_ISENABLEDV(catv, priority)) {                             \
00408          struct LogEvent _log_ev =                                      \
00409              {&(catv),priority,__FILE__,(char *)__func__,__LINE__,fmt,0};    \
00410          _log_logEvent(&(catv), &_log_ev
00411 #define _LOG_POST                               \
00412                         );                      \
00413      } } while(0)
00414 //@}
00415      
00416 /** @name Logging Macros */
00417 //@{
00418 // Thank God for Emacs...
00419 // Many repetitions follow...
00420 #define CLOG3(c, p, f) _LOG_PRE(_LOGV(c),p,f) _LOG_POST
00421 #define CTRACE2(c, f) CLOG3(c, LP_TRACE, f)
00422 #define CDEBUG2(c, f) CLOG3(c, LP_DEBUG, f)
00423 #define CINFO2(c, f) CLOG3(c, LP_INFO, f)
00424 #define CNOTICE2(c, f) CLOG3(c, LP_NOTICE, f)
00425 #define CWARNING2(c, f) CLOG3(c, LP_WARNING, f)
00426 #define CERROR2(c, f) CLOG3(c, LP_ERROR, f)
00427 #define CCRITICAL2(c, f) CLOG3(c, LP_CRITICAL, f)
00428 #define CALERT2(c, f) CLOG3(c, LP_ALERT, f)
00429 #define CEMERGENCY2(c, f) CLOG3(c, LP_EMERGENCY, f)
00430 #define LOG2(p, f)    _LOG_PRE(*_log_defaultCategory, p, f) _LOG_POST
00431 #define INFO1(f)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) _LOG_POST
00432 #define NOTICE1(f)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) _LOG_POST
00433 #define TRACE1(f)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) _LOG_POST
00434 #define DEBUG1(f)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) _LOG_POST
00435 #define WARNING1(f)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) _LOG_POST
00436 #define ERROR1(f)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) _LOG_POST
00437 #define CRITICAL1(f)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) _LOG_POST
00438 #define ALERT1(f)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f)  _LOG_POST
00439 #define EMERGENCY1(f) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f)  _LOG_POST
00440 // Many repetitions follow...
00441 #define CLOG4(c, p, f,a1) _LOG_PRE(_LOGV(c),p,f) ,a1 _LOG_POST
00442 #define CTRACE3(c, f,a1) CLOG4(c, LP_TRACE, f,a1)
00443 #define CDEBUG3(c, f,a1) CLOG4(c, LP_DEBUG, f,a1)
00444 #define CINFO3(c, f,a1) CLOG4(c, LP_INFO, f,a1)
00445 #define CNOTICE3(c, f,a1) CLOG4(c, LP_NOTICE, f,a1)
00446 #define CWARNING3(c, f,a1) CLOG4(c, LP_WARNING, f,a1)
00447 #define CERROR3(c, f,a1) CLOG4(c, LP_ERROR, f,a1)
00448 #define CCRITICAL3(c, f,a1) CLOG4(c, LP_CRITICAL, f,a1)
00449 #define CALERT3(c, f,a1) CLOG4(c, LP_ALERT, f,a1)
00450 #define CEMERGENCY3(c, f,a1) CLOG4(c, LP_EMERGENCY, f,a1)
00451 #define LOG3(p, f,a1)    _LOG_PRE(*_log_defaultCategory, p, f) ,a1 _LOG_POST
00452 #define INFO2(f,a1)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1 _LOG_POST
00453 #define NOTICE2(f,a1)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1 _LOG_POST
00454 #define TRACE2(f,a1)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1 _LOG_POST
00455 #define DEBUG2(f,a1)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1 _LOG_POST
00456 #define WARNING2(f,a1)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1 _LOG_POST
00457 #define ERROR2(f,a1)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1 _LOG_POST
00458 #define CRITICAL2(f,a1)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1 _LOG_POST
00459 #define ALERT2(f,a1)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1 _LOG_POST
00460 #define EMERGENCY2(f,a1) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1  _LOG_POST
00461 // Many repetitions follow...
00462 #define CLOG5(c, p, f,a1,a2) _LOG_PRE(_LOGV(c),p,f) ,a1,a2 _LOG_POST
00463 #define CTRACE4(c, f,a1,a2) CLOG5(c, LP_TRACE, f,a1,a2)
00464 #define CDEBUG4(c, f,a1,a2) CLOG5(c, LP_DEBUG, f,a1,a2)
00465 #define CINFO4(c, f,a1,a2) CLOG5(c, LP_INFO, f,a1,a2)
00466 #define CNOTICE4(c, f,a1,a2) CLOG5(c, LP_NOTICE, f,a1,a2)
00467 #define CWARNING4(c, f,a1,a2) CLOG5(c, LP_WARNING, f,a1,a2)
00468 #define CERROR4(c, f,a1,a2) CLOG5(c, LP_ERROR, f,a1,a2)
00469 #define CCRITICAL4(c, f,a1,a2) CLOG5(c, LP_CRITICAL, f,a1,a2)
00470 #define CALERT4(c, f,a1,a2) CLOG5(c, LP_ALERT, f,a1,a2)
00471 #define CEMERGENCY4(c, f,a1,a2) CLOG5(c, LP_EMERGENCY, f,a1,a2)
00472 #define LOG4(p, f,a1,a2)    _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2 _LOG_POST
00473 #define INFO3(f,a1,a2)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2 _LOG_POST
00474 #define NOTICE3(f,a1,a2)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2 _LOG_POST
00475 #define TRACE3(f,a1,a2)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2 _LOG_POST
00476 #define DEBUG3(f,a1,a2)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2 _LOG_POST
00477 #define WARNING3(f,a1,a2)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2 _LOG_POST
00478 #define ERROR3(f,a1,a2)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2 _LOG_POST
00479 #define CRITICAL3(f,a1,a2)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2 _LOG_POST
00480 #define ALERT3(f,a1,a2)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2 _LOG_POST
00481 #define EMERGENCY3(f,a1,a2) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2  _LOG_POST
00482 // Many repetitions follow...
00483 #define CLOG6(c, p, f,a1,a2,a3) _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3 _LOG_POST
00484 #define CTRACE5(c, f,a1,a2,a3) CLOG6(c, LP_TRACE, f,a1,a2,a3)
00485 #define CDEBUG5(c, f,a1,a2,a3) CLOG6(c, LP_DEBUG, f,a1,a2,a3)
00486 #define CINFO5(c, f,a1,a2,a3) CLOG6(c, LP_INFO, f,a1,a2,a3)
00487 #define CNOTICE5(c, f,a1,a2,a3) CLOG6(c, LP_NOTICE, f,a1,a2,a3)
00488 #define CWARNING5(c, f,a1,a2,a3) CLOG6(c, LP_WARNING, f,a1,a2,a3)
00489 #define CERROR5(c, f,a1,a2,a3) CLOG6(c, LP_ERROR, f,a1,a2,a3)
00490 #define CCRITICAL5(c, f,a1,a2,a3) CLOG6(c, LP_CRITICAL, f,a1,a2,a3)
00491 #define CALERT5(c, f,a1,a2,a3) CLOG6(c, LP_ALERT, f,a1,a2,a3)
00492 #define CEMERGENCY5(c, f,a1,a2,a3) CLOG6(c, LP_EMERGENCY, f,a1,a2,a3)
00493 #define LOG5(p, f,a1,a2,a3)    _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3 _LOG_POST
00494 #define INFO4(f,a1,a2,a3)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3 _LOG_POST
00495 #define NOTICE4(f,a1,a2,a3)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3 _LOG_POST
00496 #define TRACE4(f,a1,a2,a3)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3 _LOG_POST
00497 #define DEBUG4(f,a1,a2,a3)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3 _LOG_POST
00498 #define WARNING4(f,a1,a2,a3)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3 _LOG_POST
00499 #define ERROR4(f,a1,a2,a3)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3 _LOG_POST
00500 #define CRITICAL4(f,a1,a2,a3)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3 _LOG_POST
00501 #define ALERT4(f,a1,a2,a3)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3 _LOG_POST
00502 #define EMERGENCY4(f,a1,a2,a3) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3  _LOG_POST
00503 // Many repetitions follow...
00504 #define CLOG7(c, p, f,a1,a2,a3,a4) _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4 _LOG_POST
00505 #define CTRACE6(c, f,a1,a2,a3,a4) CLOG7(c, LP_TRACE, f,a1,a2,a3,a4)
00506 #define CDEBUG6(c, f,a1,a2,a3,a4) CLOG7(c, LP_DEBUG, f,a1,a2,a3,a4)
00507 #define CINFO6(c, f,a1,a2,a3,a4) CLOG7(c, LP_INFO, f,a1,a2,a3,a4)
00508 #define CNOTICE6(c, f,a1,a2,a3,a4) CLOG7(c, LP_NOTICE, f,a1,a2,a3,a4)
00509 #define CWARNING6(c, f,a1,a2,a3,a4) CLOG7(c, LP_WARNING, f,a1,a2,a3,a4)
00510 #define CERROR6(c, f,a1,a2,a3,a4) CLOG7(c, LP_ERROR, f,a1,a2,a3,a4)
00511 #define CCRITICAL6(c, f,a1,a2,a3,a4) CLOG7(c, LP_CRITICAL, f,a1,a2,a3,a4)
00512 #define CALERT6(c, f,a1,a2,a3,a4) CLOG7(c, LP_ALERT, f,a1,a2,a3,a4)
00513 #define CEMERGENCY6(c, f,a1,a2,a3,a4) CLOG7(c, LP_EMERGENCY, f,a1,a2,a3,a4)
00514 #define LOG6(p, f,a1,a2,a3,a4)    _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4 _LOG_POST
00515 #define INFO5(f,a1,a2,a3,a4)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4 _LOG_POST
00516 #define NOTICE5(f,a1,a2,a3,a4)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4 _LOG_POST
00517 #define TRACE5(f,a1,a2,a3,a4)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4 _LOG_POST
00518 #define DEBUG5(f,a1,a2,a3,a4)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4 _LOG_POST
00519 #define WARNING5(f,a1,a2,a3,a4)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4 _LOG_POST
00520 #define ERROR5(f,a1,a2,a3,a4)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4 _LOG_POST
00521 #define CRITICAL5(f,a1,a2,a3,a4)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4 _LOG_POST
00522 #define ALERT5(f,a1,a2,a3,a4)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4 _LOG_POST
00523 #define EMERGENCY5(f,a1,a2,a3,a4) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4  _LOG_POST
00524 // Many repetitions follow...
00525 #define CLOG8(c, p, f,a1,a2,a3,a4,a5) _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4,a5 _LOG_POST
00526 #define CTRACE7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_TRACE, f,a1,a2,a3,a4,a5)
00527 #define CDEBUG7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_DEBUG, f,a1,a2,a3,a4,a5)
00528 #define CINFO7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_INFO, f,a1,a2,a3,a4,a5)
00529 #define CNOTICE7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_NOTICE, f,a1,a2,a3,a4,a5)
00530 #define CWARNING7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_WARNING, f,a1,a2,a3,a4,a5)
00531 #define CERROR7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_ERROR, f,a1,a2,a3,a4,a5)
00532 #define CCRITICAL7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_CRITICAL, f,a1,a2,a3,a4,a5)
00533 #define CALERT7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_ALERT, f,a1,a2,a3,a4,a5)
00534 #define CEMERGENCY7(c, f,a1,a2,a3,a4,a5) CLOG8(c, LP_EMERGENCY, f,a1,a2,a3,a4,a5)
00535 #define LOG7(p, f,a1,a2,a3,a4,a5)    _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4,a5 _LOG_POST
00536 #define INFO6(f,a1,a2,a3,a4,a5)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4,a5 _LOG_POST
00537 #define NOTICE6(f,a1,a2,a3,a4,a5)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4,a5 _LOG_POST
00538 #define TRACE6(f,a1,a2,a3,a4,a5)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4,a5 _LOG_POST
00539 #define DEBUG6(f,a1,a2,a3,a4,a5)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4,a5 _LOG_POST
00540 #define WARNING6(f,a1,a2,a3,a4,a5)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4,a5 _LOG_POST
00541 #define ERROR6(f,a1,a2,a3,a4,a5)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4,a5 _LOG_POST
00542 #define CRITICAL6(f,a1,a2,a3,a4,a5)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4,a5 _LOG_POST
00543 #define ALERT6(f,a1,a2,a3,a4,a5)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4,a5 _LOG_POST
00544 #define EMERGENCY6(f,a1,a2,a3,a4,a5) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4,a5  _LOG_POST
00545 // Many repetitions follow...
00546 #define CLOG9(c, p, f,a1,a2,a3,a4,a5,a6) _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00547 #define CTRACE8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_TRACE, f,a1,a2,a3,a4,a5,a6)
00548 #define CDEBUG8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_DEBUG, f,a1,a2,a3,a4,a5,a6)
00549 #define CINFO8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_INFO, f,a1,a2,a3,a4,a5,a6)
00550 #define CNOTICE8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_NOTICE, f,a1,a2,a3,a4,a5,a6)
00551 #define CWARNING8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_WARNING, f,a1,a2,a3,a4,a5,a6)
00552 #define CERROR8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_ERROR, f,a1,a2,a3,a4,a5,a6)
00553 #define CCRITICAL8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_CRITICAL, f,a1,a2,a3,a4,a5,a6)
00554 #define CALERT8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_ALERT, f,a1,a2,a3,a4,a5,a6)
00555 #define CEMERGENCY8(c, f,a1,a2,a3,a4,a5,a6) CLOG9(c, LP_EMERGENCY, f,a1,a2,a3,a4,a5,a6)
00556 #define LOG8(p, f,a1,a2,a3,a4,a5,a6)    _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00557 #define INFO7(f,a1,a2,a3,a4,a5,a6)      _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00558 #define NOTICE7(f,a1,a2,a3,a4,a5,a6)    _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00559 #define TRACE7(f,a1,a2,a3,a4,a5,a6)     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00560 #define DEBUG7(f,a1,a2,a3,a4,a5,a6)     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00561 #define WARNING7(f,a1,a2,a3,a4,a5,a6)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00562 #define ERROR7(f,a1,a2,a3,a4,a5,a6)     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00563 #define CRITICAL7(f,a1,a2,a3,a4,a5,a6)  _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00564 #define ALERT7(f,a1,a2,a3,a4,a5,a6)     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
00565 #define EMERGENCY7(f,a1,a2,a3,a4,a5,a6) _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4,a5,a6  _LOG_POST
00566 //@}
00567 #endif // _LOG4C_H_

Generated on Fri Sep 28 00:35:45 2007 for raceintospace by  doxygen 1.5.3