log4c.h File Reference


Detailed Description

An easy-to-use, fast and flexible message logging architecture.

This is loosely based on the Apache project's Log4J, Log4CC, etc. project. Because C is not object oriented, a lot had to change.

The following documentation is a hacked version of the Log4J docs.

OVERVIEW

Log4C has 3 main concepts: category, priority and appender. These three concepts work together to enable developers to log messages according to message type and priority, and to control at runtime how these messages are formatted and where they are reported.

CATEGORY HIERARCHY

The first and foremost advantage of any logging API over plain printf() resides in its ability to disable certain log statements while allowing others to print unhindered. This capability assumes that the logging space, that is, the space of all possible logging statements, is categorized according to some developer-chosen criteria.

This observation led to choosing category as the central concept of the system. Every category is declared by providing a name and an optional parent. If no parent is explicitly named, the root category, LOG_ROOT_CAT is the category's parent.

A category is created by a macro call at the top level of a file. A category can be created with any one of the following macros:

The parent cat can be defined in the same file or in another file, but each category may have only one definition.

Typically, there will be a Category for each module and sub-module, so you can independently control logging for each module.

PRIORITY

A category may be assigned a threshold priorty. The set of priorites are defined by symbolic constants: LP_TRACE, LP_DEBUG, LP_INFO, LP_NOTICE, LP_WARNING , LP_ERROR, LP_CRITICAL, LP_ALERT, and LP_EMERGENCY. The priorities are simply non-negative integers. [It is possible to use your own set by supplying a custom appender.]

If a given category is not assigned a threshold priority, then it inherits one from its closest ancestor with an assigned threshold.

To ensure that all categories can eventually inherit a threshold, the root category always has an assigned threshold priority.

Logging requests are made by invoking a logging macro on a category. All of the macros have a printf-style format string followed by arguments. Because most C compilers do not support vararg macros, there is a version of the macro for any number of arguments from 0 to 6. The macro name ends with the total number of arguments.

Here is an example of the most basic type of macro:

CLOG5(MyCat, LP_WARN, "Values are: %d and '%s'", 5, "oops");

This is a logging request with priority WARN.

A logging request is said to be enabled if its priority is higher than or equal to the threshold priority of its category. Otherwise, the request is said to be disabled. A category without an assigned priority will inherit one from the hierarchy.

It is possible to use any non-negative integer as a priority. If, as in the example, one of the standard priorites is used, then there is a convenience macro that is typically used instead. For example, the above example is equivalent to the shorter:

CWARN4(MyCat, "Values are: %d and '%s'", 5, "oops");

DEFAULT CATEGORY

If LOG_NEW_DEFAULT_SUBCATEGORY(MyCat, Parent) or LOG_NEW_DEFAULT_CATEGORY(MyCat) is used to create the category, then the even shorter form can be used:

WARN3("Values are: %d and '%s'", 5, "oops");

Only one default category can be created per file, though multiple non-defaults can be created and used.

EXAMPLE

Here is a more complete example:

      #include "log4c.h"

      // create a category and a default subcategory
      LOG_NEW_CATEGORY(VSS);
      LOG_NEW_DEFAULT_SUBCATEGORY(SA, VSS);

      main() {
             // Now set the parent's priority.
             // (the string would typcially be a runtime option)
             log_setControlString("SA.thresh=3");

             // This request is enabled, because WARNING >= INFO.
             CWARN2(VSS, "Low fuel level.");

             // This request is disabled, because DEBUG < INFO.
             CDEBUG2(VSS, "Starting search for nearest gas station."); 

             // The default category SA inherits its priority from VSS. Thus,
             // the following request is enabled because INFO >= INFO.  
             INFO1("Located nearest gas station.");

             // This request is disabled, because DEBUG < INFO.
             DEBUG1("Exiting gas station search");
       }

PERFORMANCE

Clever design insures efficiency. Except for the first invocation, a disabled logging request requires an a single comparison of a static variable to a constant.

There is also compile time constant, LOG_STATIC_THRESHOLD, which causes all logging requests with a lower priority to be optimized to 0 cost by the compiler. By setting it to LP_INFINITE, all logging requests are statically disabled and cost nothing. Released executables might typically be compiled with "-DLOG_STATIC_THRESHOLD=LP_INFO"

APPENDERS

Each category has an optional appender. An appender is a pointer to a structure whcih starts with a pointer to a doAppend() function. DoAppend() prints a message to a log.

WHen a category is passed a message by one of the logging macros, the category performs the following actions:

1. if the category has an appender, the message is passed to the appender's doAppend() function,

2. if 'willLogToParent' is true for the category, the message is passed to the category's parent.

By default, all categories except root have no appender and 'willLogToParent' is true. This situation causes all messages to be logged by the root category's appender.

Typically, you would only change the root category's appender when you wanted, say, a different output format. Copying log_default.c would be a good start.

The default appender function currently prints to stderr.

MISC

Do not use any of the macros that start with '_'.

CAVEATS

Category names are global variables.

Definition in file log4c.h.

#include "race.h"
#include <stdarg.h>

Go to the source code of this file.

Data Structures

struct  LogAppender
struct  LogCategory
 Do NOT access any members of this structure directly. More...
struct  LogEvent

Defines

#define _LOG_CONCAT(x, y)   x ## _ ## y
#define _LOG_ISENABLEDV(catv, priority)
 Helper function that implements LOG_ISENABLED.
#define _LOGV(cat)   _LOG_CONCAT(_log_c, cat)
 Transforms a category name to a global variable name.
#define LOG_DEFAULT_CATEGORY(cname)   static struct LogCategory* _log_defaultCategory = &_LOGV(cname);
 Creates a new subcategory of the root category.
#define LOG_EXPORT_CATEGORY(catName)   extern struct LogCategory _LOGV(catName)
 Exports category (use this one in header files).
#define LOG_ISENABLED(catName, priority)   _LOG_ISENABLEDV(_LOGV(catName), priority)
 Returns true if the given priority is enabled for the category.
#define LOG_NEW_CATEGORY(catName)   LOG_NEW_SUBCATEGORY(catName, LOG_ROOT_CAT)
 Creates a new subcategory of the root category.
#define LOG_NEW_DEFAULT_CATEGORY(cname)
 Creates a new subcategory of the root category and makes it the default (used by macros that don't explicitly specify a category).
#define LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent)
 Creates a new subcategory of the parent category and makes it the default (used by macros that don't explicitly specify a category).
#define LOG_NEW_SUBCATEGORY(catName, parent)
 Defines a new subcategory of the parent.
#define LOG_ROOT_CAT   root
 The root of the category hierarchy.
Internal Macros
Some kludge macros to ease maintenance.

See how they're used below.

IMPLEMENTATION NOTE: To reduce the parameter passing overhead of an enabled message, the many parameters passed to the logging function are packed in a structure. Since these values will be usually be passed to at least 3 functions, this is a win. It also allows adding new values (such as a timestamp) without breaking code. Setting the LogEvent's valist member is done inside _log_logEvent. UPDATE: we set va_list to 0 to shut up the compiler.

#define _LOG_POST
#define _LOG_PRE(catv, priority, fmt)
Logging Macros
#define ALERT1(f)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) _LOG_POST
#define ALERT2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1 _LOG_POST
#define ALERT3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2 _LOG_POST
#define ALERT4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3 _LOG_POST
#define ALERT5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4 _LOG_POST
#define ALERT6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define ALERT7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define CALERT2(c, f)   CLOG3(c, LP_ALERT, f)
#define CALERT3(c, f, a1)   CLOG4(c, LP_ALERT, f,a1)
#define CALERT4(c, f, a1, a2)   CLOG5(c, LP_ALERT, f,a1,a2)
#define CALERT5(c, f, a1, a2, a3)   CLOG6(c, LP_ALERT, f,a1,a2,a3)
#define CALERT6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_ALERT, f,a1,a2,a3,a4)
#define CALERT7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_ALERT, f,a1,a2,a3,a4,a5)
#define CALERT8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_ALERT, f,a1,a2,a3,a4,a5,a6)
#define CCRITICAL2(c, f)   CLOG3(c, LP_CRITICAL, f)
#define CCRITICAL3(c, f, a1)   CLOG4(c, LP_CRITICAL, f,a1)
#define CCRITICAL4(c, f, a1, a2)   CLOG5(c, LP_CRITICAL, f,a1,a2)
#define CCRITICAL5(c, f, a1, a2, a3)   CLOG6(c, LP_CRITICAL, f,a1,a2,a3)
#define CCRITICAL6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_CRITICAL, f,a1,a2,a3,a4)
#define CCRITICAL7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_CRITICAL, f,a1,a2,a3,a4,a5)
#define CCRITICAL8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_CRITICAL, f,a1,a2,a3,a4,a5,a6)
#define CDEBUG2(c, f)   CLOG3(c, LP_DEBUG, f)
#define CDEBUG3(c, f, a1)   CLOG4(c, LP_DEBUG, f,a1)
#define CDEBUG4(c, f, a1, a2)   CLOG5(c, LP_DEBUG, f,a1,a2)
#define CDEBUG5(c, f, a1, a2, a3)   CLOG6(c, LP_DEBUG, f,a1,a2,a3)
#define CDEBUG6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_DEBUG, f,a1,a2,a3,a4)
#define CDEBUG7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_DEBUG, f,a1,a2,a3,a4,a5)
#define CDEBUG8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_DEBUG, f,a1,a2,a3,a4,a5,a6)
#define CEMERGENCY2(c, f)   CLOG3(c, LP_EMERGENCY, f)
#define CEMERGENCY3(c, f, a1)   CLOG4(c, LP_EMERGENCY, f,a1)
#define CEMERGENCY4(c, f, a1, a2)   CLOG5(c, LP_EMERGENCY, f,a1,a2)
#define CEMERGENCY5(c, f, a1, a2, a3)   CLOG6(c, LP_EMERGENCY, f,a1,a2,a3)
#define CEMERGENCY6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_EMERGENCY, f,a1,a2,a3,a4)
#define CEMERGENCY7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_EMERGENCY, f,a1,a2,a3,a4,a5)
#define CEMERGENCY8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_EMERGENCY, f,a1,a2,a3,a4,a5,a6)
#define CERROR2(c, f)   CLOG3(c, LP_ERROR, f)
#define CERROR3(c, f, a1)   CLOG4(c, LP_ERROR, f,a1)
#define CERROR4(c, f, a1, a2)   CLOG5(c, LP_ERROR, f,a1,a2)
#define CERROR5(c, f, a1, a2, a3)   CLOG6(c, LP_ERROR, f,a1,a2,a3)
#define CERROR6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_ERROR, f,a1,a2,a3,a4)
#define CERROR7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_ERROR, f,a1,a2,a3,a4,a5)
#define CERROR8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_ERROR, f,a1,a2,a3,a4,a5,a6)
#define CINFO2(c, f)   CLOG3(c, LP_INFO, f)
#define CINFO3(c, f, a1)   CLOG4(c, LP_INFO, f,a1)
#define CINFO4(c, f, a1, a2)   CLOG5(c, LP_INFO, f,a1,a2)
#define CINFO5(c, f, a1, a2, a3)   CLOG6(c, LP_INFO, f,a1,a2,a3)
#define CINFO6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_INFO, f,a1,a2,a3,a4)
#define CINFO7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_INFO, f,a1,a2,a3,a4,a5)
#define CINFO8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_INFO, f,a1,a2,a3,a4,a5,a6)
#define CLOG3(c, p, f)   _LOG_PRE(_LOGV(c),p,f) _LOG_POST
#define CLOG4(c, p, f, a1)   _LOG_PRE(_LOGV(c),p,f) ,a1 _LOG_POST
#define CLOG5(c, p, f, a1, a2)   _LOG_PRE(_LOGV(c),p,f) ,a1,a2 _LOG_POST
#define CLOG6(c, p, f, a1, a2, a3)   _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3 _LOG_POST
#define CLOG7(c, p, f, a1, a2, a3, a4)   _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4 _LOG_POST
#define CLOG8(c, p, f, a1, a2, a3, a4, a5)   _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4,a5 _LOG_POST
#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
#define CNOTICE2(c, f)   CLOG3(c, LP_NOTICE, f)
#define CNOTICE3(c, f, a1)   CLOG4(c, LP_NOTICE, f,a1)
#define CNOTICE4(c, f, a1, a2)   CLOG5(c, LP_NOTICE, f,a1,a2)
#define CNOTICE5(c, f, a1, a2, a3)   CLOG6(c, LP_NOTICE, f,a1,a2,a3)
#define CNOTICE6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_NOTICE, f,a1,a2,a3,a4)
#define CNOTICE7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_NOTICE, f,a1,a2,a3,a4,a5)
#define CNOTICE8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_NOTICE, f,a1,a2,a3,a4,a5,a6)
#define CRITICAL1(f)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) _LOG_POST
#define CRITICAL2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1 _LOG_POST
#define CRITICAL3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2 _LOG_POST
#define CRITICAL4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3 _LOG_POST
#define CRITICAL5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4 _LOG_POST
#define CRITICAL6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define CRITICAL7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define CTRACE2(c, f)   CLOG3(c, LP_TRACE, f)
#define CTRACE3(c, f, a1)   CLOG4(c, LP_TRACE, f,a1)
#define CTRACE4(c, f, a1, a2)   CLOG5(c, LP_TRACE, f,a1,a2)
#define CTRACE5(c, f, a1, a2, a3)   CLOG6(c, LP_TRACE, f,a1,a2,a3)
#define CTRACE6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_TRACE, f,a1,a2,a3,a4)
#define CTRACE7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_TRACE, f,a1,a2,a3,a4,a5)
#define CTRACE8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_TRACE, f,a1,a2,a3,a4,a5,a6)
#define CWARNING2(c, f)   CLOG3(c, LP_WARNING, f)
#define CWARNING3(c, f, a1)   CLOG4(c, LP_WARNING, f,a1)
#define CWARNING4(c, f, a1, a2)   CLOG5(c, LP_WARNING, f,a1,a2)
#define CWARNING5(c, f, a1, a2, a3)   CLOG6(c, LP_WARNING, f,a1,a2,a3)
#define CWARNING6(c, f, a1, a2, a3, a4)   CLOG7(c, LP_WARNING, f,a1,a2,a3,a4)
#define CWARNING7(c, f, a1, a2, a3, a4, a5)   CLOG8(c, LP_WARNING, f,a1,a2,a3,a4,a5)
#define CWARNING8(c, f, a1, a2, a3, a4, a5, a6)   CLOG9(c, LP_WARNING, f,a1,a2,a3,a4,a5,a6)
#define DEBUG1(f)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) _LOG_POST
#define DEBUG2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1 _LOG_POST
#define DEBUG3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2 _LOG_POST
#define DEBUG4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3 _LOG_POST
#define DEBUG5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4 _LOG_POST
#define DEBUG6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define DEBUG7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define EMERGENCY1(f)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) _LOG_POST
#define EMERGENCY2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1 _LOG_POST
#define EMERGENCY3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2 _LOG_POST
#define EMERGENCY4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3 _LOG_POST
#define EMERGENCY5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4 _LOG_POST
#define EMERGENCY6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define EMERGENCY7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define ERROR1(f)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) _LOG_POST
#define ERROR2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1 _LOG_POST
#define ERROR3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2 _LOG_POST
#define ERROR4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3 _LOG_POST
#define ERROR5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4 _LOG_POST
#define ERROR6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define ERROR7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define INFO1(f)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) _LOG_POST
#define INFO2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1 _LOG_POST
#define INFO3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2 _LOG_POST
#define INFO4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3 _LOG_POST
#define INFO5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4 _LOG_POST
#define INFO6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define INFO7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define LOG2(p, f)   _LOG_PRE(*_log_defaultCategory, p, f) _LOG_POST
#define LOG3(p, f, a1)   _LOG_PRE(*_log_defaultCategory, p, f) ,a1 _LOG_POST
#define LOG4(p, f, a1, a2)   _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2 _LOG_POST
#define LOG5(p, f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3 _LOG_POST
#define LOG6(p, f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4 _LOG_POST
#define LOG7(p, f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define LOG8(p, f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define NOTICE1(f)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) _LOG_POST
#define NOTICE2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1 _LOG_POST
#define NOTICE3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2 _LOG_POST
#define NOTICE4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3 _LOG_POST
#define NOTICE5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4 _LOG_POST
#define NOTICE6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define NOTICE7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define TRACE1(f)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) _LOG_POST
#define TRACE2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1 _LOG_POST
#define TRACE3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2 _LOG_POST
#define TRACE4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3 _LOG_POST
#define TRACE5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4 _LOG_POST
#define TRACE6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define TRACE7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
#define WARNING1(f)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) _LOG_POST
#define WARNING2(f, a1)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1 _LOG_POST
#define WARNING3(f, a1, a2)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2 _LOG_POST
#define WARNING4(f, a1, a2, a3)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3 _LOG_POST
#define WARNING5(f, a1, a2, a3, a4)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4 _LOG_POST
#define WARNING6(f, a1, a2, a3, a4, a5)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4,a5 _LOG_POST
#define WARNING7(f, a1, a2, a3, a4, a5, a6)   _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST
Priority Values
These are the same names (except TRACE is new) as used by Unix syslog(), but the numerical values are different.

#define LOG_STATIC_THRESHOLD   LP_NONE
 All logging with priority < LOG_STATIC_THRESHOLD is disabled at compile time, i.e., compiled out.
#define LP_ALERT   8
#define LP_CRITICAL   7
#define LP_DEBUG   2
#define LP_EMERGENCY   9
#define LP_ERROR   6
#define LP_INFO   3
#define LP_NONE   0
#define LP_NOTICE   4
#define LP_TRACE   1
#define LP_UNINITIALIZED   -1
 for internal use only
#define LP_WARNING   5

Functions

int _log_initCat (int priority, struct LogCategory *category)
 This gets called the first time a category is referenced and performs the initialization.
void _log_logEvent (struct LogCategory *category, struct LogEvent *ev,...)
struct LogCategory _LOGV (LOG_ROOT_CAT)
void log_setAppender (struct LogCategory *cat, struct LogAppender *app)
 Sets the category's appender.
void log_setParent (struct LogCategory *cat, struct LogCategory *parent)
 Programatically alter a category's parent.
void log_setThreshold (struct LogCategory *cat, int thresholdPriority)
 Programatically alters a category's threshold priority.

Variables

struct LogAppenderlog_defaultLogAppender


Define Documentation

#define _LOG_CONCAT ( x,
y   )     x ## _ ## y

Definition at line 242 of file log4c.h.

#define _LOG_ISENABLEDV ( catv,
priority   ) 

Value:

(priority >= LOG_STATIC_THRESHOLD                        \
        && priority >= (catv).thresholdPriority                 \
        && ((catv).thresholdPriority != LP_UNINITIALIZED        \
            || _log_initCat(priority, &(catv))) )
Helper function that implements LOG_ISENABLED.

NOTES First part is a compile-time constant. Call to _log_initCat only happens once.

Definition at line 386 of file log4c.h.

#define _LOG_POST

Value:

);                      \
     } } while(0)

Definition at line 411 of file log4c.h.

#define _LOG_PRE ( catv,
priority,
fmt   ) 

Value:

do {                              \
     if (_LOG_ISENABLEDV(catv, priority)) {                             \
         struct LogEvent _log_ev =                                      \
             {&(catv),priority,__FILE__,(char *)__func__,__LINE__,fmt,0};    \
         _log_logEvent(&(catv), &_log_ev

Definition at line 406 of file log4c.h.

#define _LOGV ( cat   )     _LOG_CONCAT(_log_c, cat)

Transforms a category name to a global variable name.

Definition at line 241 of file log4c.h.

Referenced by initCategory(), and main().

#define ALERT1 (  )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) _LOG_POST

Definition at line 438 of file log4c.h.

#define ALERT2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1 _LOG_POST

Definition at line 459 of file log4c.h.

#define ALERT3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2 _LOG_POST

Definition at line 480 of file log4c.h.

#define ALERT4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3 _LOG_POST

Definition at line 501 of file log4c.h.

#define ALERT5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 522 of file log4c.h.

#define ALERT6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 543 of file log4c.h.

#define ALERT7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_ALERT, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 564 of file log4c.h.

#define CALERT2 ( c,
 )     CLOG3(c, LP_ALERT, f)

Definition at line 428 of file log4c.h.

#define CALERT3 ( c,
f,
a1   )     CLOG4(c, LP_ALERT, f,a1)

Definition at line 449 of file log4c.h.

#define CALERT4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_ALERT, f,a1,a2)

Definition at line 470 of file log4c.h.

#define CALERT5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_ALERT, f,a1,a2,a3)

Definition at line 491 of file log4c.h.

#define CALERT6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_ALERT, f,a1,a2,a3,a4)

Definition at line 512 of file log4c.h.

#define CALERT7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_ALERT, f,a1,a2,a3,a4,a5)

Definition at line 533 of file log4c.h.

#define CALERT8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_ALERT, f,a1,a2,a3,a4,a5,a6)

Definition at line 554 of file log4c.h.

#define CCRITICAL2 ( c,
 )     CLOG3(c, LP_CRITICAL, f)

Definition at line 427 of file log4c.h.

#define CCRITICAL3 ( c,
f,
a1   )     CLOG4(c, LP_CRITICAL, f,a1)

Definition at line 448 of file log4c.h.

#define CCRITICAL4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_CRITICAL, f,a1,a2)

Definition at line 469 of file log4c.h.

#define CCRITICAL5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_CRITICAL, f,a1,a2,a3)

Definition at line 490 of file log4c.h.

#define CCRITICAL6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_CRITICAL, f,a1,a2,a3,a4)

Definition at line 511 of file log4c.h.

#define CCRITICAL7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_CRITICAL, f,a1,a2,a3,a4,a5)

Definition at line 532 of file log4c.h.

#define CCRITICAL8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_CRITICAL, f,a1,a2,a3,a4,a5,a6)

Definition at line 553 of file log4c.h.

#define CDEBUG2 ( c,
 )     CLOG3(c, LP_DEBUG, f)

Definition at line 422 of file log4c.h.

#define CDEBUG3 ( c,
f,
a1   )     CLOG4(c, LP_DEBUG, f,a1)

Definition at line 443 of file log4c.h.

#define CDEBUG4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_DEBUG, f,a1,a2)

Definition at line 464 of file log4c.h.

Referenced by load_audio_file().

#define CDEBUG5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_DEBUG, f,a1,a2,a3)

Definition at line 485 of file log4c.h.

#define CDEBUG6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_DEBUG, f,a1,a2,a3,a4)

Definition at line 506 of file log4c.h.

#define CDEBUG7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_DEBUG, f,a1,a2,a3,a4,a5)

Definition at line 527 of file log4c.h.

#define CDEBUG8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_DEBUG, f,a1,a2,a3,a4,a5,a6)

Definition at line 548 of file log4c.h.

#define CEMERGENCY2 ( c,
 )     CLOG3(c, LP_EMERGENCY, f)

Definition at line 429 of file log4c.h.

#define CEMERGENCY3 ( c,
f,
a1   )     CLOG4(c, LP_EMERGENCY, f,a1)

Definition at line 450 of file log4c.h.

#define CEMERGENCY4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_EMERGENCY, f,a1,a2)

Definition at line 471 of file log4c.h.

#define CEMERGENCY5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_EMERGENCY, f,a1,a2,a3)

Definition at line 492 of file log4c.h.

#define CEMERGENCY6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_EMERGENCY, f,a1,a2,a3,a4)

Definition at line 513 of file log4c.h.

#define CEMERGENCY7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_EMERGENCY, f,a1,a2,a3,a4,a5)

Definition at line 534 of file log4c.h.

#define CEMERGENCY8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_EMERGENCY, f,a1,a2,a3,a4,a5,a6)

Definition at line 555 of file log4c.h.

#define CERROR2 ( c,
 )     CLOG3(c, LP_ERROR, f)

Definition at line 426 of file log4c.h.

#define CERROR3 ( c,
f,
a1   )     CLOG4(c, LP_ERROR, f,a1)

Definition at line 447 of file log4c.h.

Referenced by load_audio_file().

#define CERROR4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_ERROR, f,a1,a2)

Definition at line 468 of file log4c.h.

#define CERROR5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_ERROR, f,a1,a2,a3)

Definition at line 489 of file log4c.h.

#define CERROR6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_ERROR, f,a1,a2,a3,a4)

Definition at line 510 of file log4c.h.

#define CERROR7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_ERROR, f,a1,a2,a3,a4,a5)

Definition at line 531 of file log4c.h.

#define CERROR8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_ERROR, f,a1,a2,a3,a4,a5,a6)

Definition at line 552 of file log4c.h.

#define CINFO2 ( c,
 )     CLOG3(c, LP_INFO, f)

Definition at line 423 of file log4c.h.

#define CINFO3 ( c,
f,
a1   )     CLOG4(c, LP_INFO, f,a1)

Definition at line 444 of file log4c.h.

Referenced by play_audio().

#define CINFO4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_INFO, f,a1,a2)

Definition at line 465 of file log4c.h.

#define CINFO5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_INFO, f,a1,a2,a3)

Definition at line 486 of file log4c.h.

#define CINFO6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_INFO, f,a1,a2,a3,a4)

Definition at line 507 of file log4c.h.

#define CINFO7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_INFO, f,a1,a2,a3,a4,a5)

Definition at line 528 of file log4c.h.

#define CINFO8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_INFO, f,a1,a2,a3,a4,a5,a6)

Definition at line 549 of file log4c.h.

#define CLOG3 ( c,
p,
 )     _LOG_PRE(_LOGV(c),p,f) _LOG_POST

Definition at line 420 of file log4c.h.

#define CLOG4 ( c,
p,
f,
a1   )     _LOG_PRE(_LOGV(c),p,f) ,a1 _LOG_POST

Definition at line 441 of file log4c.h.

#define CLOG5 ( c,
p,
f,
a1,
a2   )     _LOG_PRE(_LOGV(c),p,f) ,a1,a2 _LOG_POST

Definition at line 462 of file log4c.h.

#define CLOG6 ( c,
p,
f,
a1,
a2,
a3   )     _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3 _LOG_POST

Definition at line 483 of file log4c.h.

#define CLOG7 ( c,
p,
f,
a1,
a2,
a3,
a4   )     _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 504 of file log4c.h.

#define CLOG8 ( c,
p,
f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(_LOGV(c),p,f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 525 of file log4c.h.

#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

Definition at line 546 of file log4c.h.

#define CNOTICE2 ( c,
 )     CLOG3(c, LP_NOTICE, f)

Definition at line 424 of file log4c.h.

#define CNOTICE3 ( c,
f,
a1   )     CLOG4(c, LP_NOTICE, f,a1)

Definition at line 445 of file log4c.h.

#define CNOTICE4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_NOTICE, f,a1,a2)

Definition at line 466 of file log4c.h.

#define CNOTICE5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_NOTICE, f,a1,a2,a3)

Definition at line 487 of file log4c.h.

#define CNOTICE6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_NOTICE, f,a1,a2,a3,a4)

Definition at line 508 of file log4c.h.

#define CNOTICE7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_NOTICE, f,a1,a2,a3,a4,a5)

Definition at line 529 of file log4c.h.

#define CNOTICE8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_NOTICE, f,a1,a2,a3,a4,a5,a6)

Definition at line 550 of file log4c.h.

#define CRITICAL1 (  )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) _LOG_POST

Definition at line 437 of file log4c.h.

Referenced by main(), MakeRecords(), read_img_frame(), and read_intro_images().

#define CRITICAL2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1 _LOG_POST

Definition at line 458 of file log4c.h.

Referenced by av_setup(), slurp_gamedat(), xcalloc(), xmalloc(), and xrealloc().

#define CRITICAL3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2 _LOG_POST

Definition at line 479 of file log4c.h.

Referenced by main().

#define CRITICAL4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3 _LOG_POST

Definition at line 500 of file log4c.h.

#define CRITICAL5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 521 of file log4c.h.

#define CRITICAL6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 542 of file log4c.h.

#define CRITICAL7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_CRITICAL, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 563 of file log4c.h.

#define CTRACE2 ( c,
 )     CLOG3(c, LP_TRACE, f)

Definition at line 421 of file log4c.h.

#define CTRACE3 ( c,
f,
a1   )     CLOG4(c, LP_TRACE, f,a1)

Definition at line 442 of file log4c.h.

#define CTRACE4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_TRACE, f,a1,a2)

Definition at line 463 of file log4c.h.

Referenced by PlayNewsAnim().

#define CTRACE5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_TRACE, f,a1,a2,a3)

Definition at line 484 of file log4c.h.

#define CTRACE6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_TRACE, f,a1,a2,a3,a4)

Definition at line 505 of file log4c.h.

#define CTRACE7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_TRACE, f,a1,a2,a3,a4,a5)

Definition at line 526 of file log4c.h.

#define CTRACE8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_TRACE, f,a1,a2,a3,a4,a5,a6)

Definition at line 547 of file log4c.h.

#define CWARNING2 ( c,
 )     CLOG3(c, LP_WARNING, f)

Definition at line 425 of file log4c.h.

#define CWARNING3 ( c,
f,
a1   )     CLOG4(c, LP_WARNING, f,a1)

Definition at line 446 of file log4c.h.

Referenced by DispVA(), fread_dyn(), and load_audio_file().

#define CWARNING4 ( c,
f,
a1,
a2   )     CLOG5(c, LP_WARNING, f,a1,a2)

Definition at line 467 of file log4c.h.

Referenced by play_audio().

#define CWARNING5 ( c,
f,
a1,
a2,
a3   )     CLOG6(c, LP_WARNING, f,a1,a2,a3)

Definition at line 488 of file log4c.h.

#define CWARNING6 ( c,
f,
a1,
a2,
a3,
a4   )     CLOG7(c, LP_WARNING, f,a1,a2,a3,a4)

Definition at line 509 of file log4c.h.

#define CWARNING7 ( c,
f,
a1,
a2,
a3,
a4,
a5   )     CLOG8(c, LP_WARNING, f,a1,a2,a3,a4,a5)

Definition at line 530 of file log4c.h.

#define CWARNING8 ( c,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     CLOG9(c, LP_WARNING, f,a1,a2,a3,a4,a5,a6)

Definition at line 551 of file log4c.h.

#define DEBUG1 (  )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) _LOG_POST

Definition at line 434 of file log4c.h.

Referenced by Future(), GetFailStat(), MissionName(), Missions(), mm_open_fp(), PianoKey(), play(), PlaySequence(), TogBox(), and Toggle().

#define DEBUG2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1 _LOG_POST

Definition at line 455 of file log4c.h.

Referenced by av_process_event(), GetFailStat(), main(), PianoKey(), Replay(), and try_find_file().

#define DEBUG3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2 _LOG_POST

Definition at line 476 of file log4c.h.

Referenced by DrawFuture(), main(), Replay(), and Toggle().

#define DEBUG4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3 _LOG_POST

Definition at line 497 of file log4c.h.

Referenced by frm_read_tbl(), PlaySequence(), and TogBox().

#define DEBUG5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 518 of file log4c.h.

Referenced by MissionName(), and Missions().

#define DEBUG6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 539 of file log4c.h.

Referenced by MisCheck().

#define DEBUG7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_DEBUG, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 560 of file log4c.h.

#define EMERGENCY1 (  )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) _LOG_POST

Definition at line 439 of file log4c.h.

#define EMERGENCY2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1 _LOG_POST

Definition at line 460 of file log4c.h.

#define EMERGENCY3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2 _LOG_POST

Definition at line 481 of file log4c.h.

#define EMERGENCY4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3 _LOG_POST

Definition at line 502 of file log4c.h.

#define EMERGENCY5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 523 of file log4c.h.

#define EMERGENCY6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 544 of file log4c.h.

#define EMERGENCY7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_EMERGENCY, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 565 of file log4c.h.

#define ERROR1 (  )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) _LOG_POST

Definition at line 436 of file log4c.h.

Referenced by get_page().

#define ERROR2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1 _LOG_POST

Definition at line 457 of file log4c.h.

Referenced by av_setup(), and setup_options().

#define ERROR3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2 _LOG_POST

Definition at line 478 of file log4c.h.

#define ERROR4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3 _LOG_POST

Definition at line 499 of file log4c.h.

#define ERROR5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 520 of file log4c.h.

#define ERROR6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 541 of file log4c.h.

#define ERROR7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_ERROR, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 562 of file log4c.h.

#define INFO1 (  )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) _LOG_POST

Definition at line 431 of file log4c.h.

Referenced by av_setup(), init_theora(), and init_vorbis().

#define INFO2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1 _LOG_POST

Definition at line 452 of file log4c.h.

Referenced by AbzFrame(), av_setup(), get_packet(), locate_file(), mm_open(), PlaySequence(), remove_savedat(), and Replay().

#define INFO3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2 _LOG_POST

Definition at line 473 of file log4c.h.

Referenced by mm_open_fp(), and sOpen().

#define INFO4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3 _LOG_POST

Definition at line 494 of file log4c.h.

Referenced by mm_open_fp().

#define INFO5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 515 of file log4c.h.

#define INFO6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 536 of file log4c.h.

#define INFO7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_INFO, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 557 of file log4c.h.

#define LOG2 ( p,
 )     _LOG_PRE(*_log_defaultCategory, p, f) _LOG_POST

Definition at line 430 of file log4c.h.

#define LOG3 ( p,
f,
a1   )     _LOG_PRE(*_log_defaultCategory, p, f) ,a1 _LOG_POST

Definition at line 451 of file log4c.h.

#define LOG4 ( p,
f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2 _LOG_POST

Definition at line 472 of file log4c.h.

#define LOG5 ( p,
f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3 _LOG_POST

Definition at line 493 of file log4c.h.

#define LOG6 ( p,
f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 514 of file log4c.h.

#define LOG7 ( p,
f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 535 of file log4c.h.

#define LOG8 ( p,
f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, p, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 556 of file log4c.h.

#define LOG_DEFAULT_CATEGORY ( cname   )     static struct LogCategory* _log_defaultCategory = &_LOGV(cname);

Creates a new subcategory of the root category.

Definition at line 272 of file log4c.h.

#define LOG_EXPORT_CATEGORY ( catName   )     extern struct LogCategory _LOGV(catName)

Exports category (use this one in header files).

Definition at line 266 of file log4c.h.

#define LOG_ISENABLED ( catName,
priority   )     _LOG_ISENABLEDV(_LOGV(catName), priority)

Returns true if the given priority is enabled for the category.

If you have expensive expressions that are computed outside of the log command and used only within it, you should make its evaluation conditional using this macro.

Definition at line 376 of file log4c.h.

#define LOG_NEW_CATEGORY ( catName   )     LOG_NEW_SUBCATEGORY(catName, LOG_ROOT_CAT)

Creates a new subcategory of the root category.

Definition at line 261 of file log4c.h.

#define LOG_NEW_DEFAULT_CATEGORY ( cname   ) 

Value:

Creates a new subcategory of the root category and makes it the default (used by macros that don't explicitly specify a category).

Definition at line 279 of file log4c.h.

#define LOG_NEW_DEFAULT_SUBCATEGORY ( cname,
parent   ) 

Value:

LOG_NEW_SUBCATEGORY(cname, parent);                 \
    LOG_DEFAULT_CATEGORY(cname);
Creates a new subcategory of the parent category and makes it the default (used by macros that don't explicitly specify a category).

Definition at line 287 of file log4c.h.

#define LOG_NEW_SUBCATEGORY ( catName,
parent   ) 

Value:

extern struct LogCategory _LOGV(parent);    \
    struct LogCategory _LOGV(catName) = {       \
        &_LOGV(parent), 0, 0,                   \
        #catName, LP_UNINITIALIZED, 1,          \
        0, 1                                    \
    };
Defines a new subcategory of the parent.

Definition at line 250 of file log4c.h.

#define LOG_ROOT_CAT   root

The root of the category hierarchy.

Definition at line 246 of file log4c.h.

Referenced by initCategory(), and main().

#define LOG_STATIC_THRESHOLD   LP_NONE

All logging with priority < LOG_STATIC_THRESHOLD is disabled at compile time, i.e., compiled out.

Definition at line 235 of file log4c.h.

#define LP_ALERT   8

Definition at line 225 of file log4c.h.

#define LP_CRITICAL   7

Definition at line 224 of file log4c.h.

#define LP_DEBUG   2

Definition at line 219 of file log4c.h.

#define LP_EMERGENCY   9

Definition at line 226 of file log4c.h.

#define LP_ERROR   6

Definition at line 223 of file log4c.h.

#define LP_INFO   3

Definition at line 220 of file log4c.h.

#define LP_NONE   0

Definition at line 217 of file log4c.h.

#define LP_NOTICE   4

Definition at line 221 of file log4c.h.

Referenced by main().

#define LP_TRACE   1

Definition at line 218 of file log4c.h.

#define LP_UNINITIALIZED   -1

for internal use only

Definition at line 228 of file log4c.h.

Referenced by initCategory(), and log_setParent().

#define LP_WARNING   5

Definition at line 222 of file log4c.h.

Referenced by initCategory().

#define NOTICE1 (  )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) _LOG_POST

Definition at line 432 of file log4c.h.

Referenced by av_setup(), DoModem(), main(), and read_config_file().

#define NOTICE2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1 _LOG_POST

Definition at line 453 of file log4c.h.

Referenced by main(), and read_config_file().

#define NOTICE3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2 _LOG_POST

Definition at line 474 of file log4c.h.

Referenced by write_default_config().

#define NOTICE4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3 _LOG_POST

Definition at line 495 of file log4c.h.

#define NOTICE5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 516 of file log4c.h.

#define NOTICE6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 537 of file log4c.h.

#define NOTICE7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_NOTICE, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 558 of file log4c.h.

#define TRACE1 (  )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) _LOG_POST

Definition at line 433 of file log4c.h.

#define TRACE2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1 _LOG_POST

Definition at line 454 of file log4c.h.

#define TRACE3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2 _LOG_POST

Definition at line 475 of file log4c.h.

Referenced by try_fopen().

#define TRACE4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3 _LOG_POST

Definition at line 496 of file log4c.h.

Referenced by av_process_event(), and av_sync().

#define TRACE5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 517 of file log4c.h.

#define TRACE6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 538 of file log4c.h.

#define TRACE7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_TRACE, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 559 of file log4c.h.

#define WARNING1 (  )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) _LOG_POST

Definition at line 435 of file log4c.h.

Referenced by main(), mm_decode_audio(), mm_decode_video(), mm_open_fp(), OpenAnim(), read_config_file(), read_img_frame(), save_game(), and yuv_to_overlay().

#define WARNING2 ( f,
a1   )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1 _LOG_POST

Definition at line 456 of file log4c.h.

Referenced by frm_read_tbl(), get_packet(), music_load(), music_start_loop(), save_game(), setup_options(), and write_default_config().

#define WARNING3 ( f,
a1,
a2   )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2 _LOG_POST

Definition at line 477 of file log4c.h.

Referenced by create_save_dir(), remove_savedat(), try_find_file(), and try_fopen().

#define WARNING4 ( f,
a1,
a2,
a3   )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3 _LOG_POST

Definition at line 498 of file log4c.h.

Referenced by write_default_config().

#define WARNING5 ( f,
a1,
a2,
a3,
a4   )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4 _LOG_POST

Definition at line 519 of file log4c.h.

#define WARNING6 ( f,
a1,
a2,
a3,
a4,
a5   )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4,a5 _LOG_POST

Definition at line 540 of file log4c.h.

#define WARNING7 ( f,
a1,
a2,
a3,
a4,
a5,
a6   )     _LOG_PRE(*_log_defaultCategory, LP_WARNING, f) ,a1,a2,a3,a4,a5,a6 _LOG_POST

Definition at line 561 of file log4c.h.


Function Documentation

int _log_initCat ( int  priority,
struct LogCategory category 
)

This gets called the first time a category is referenced and performs the initialization.

Also resets threshold to inherited!

Definition at line 126 of file log4c.c.

References initCategory(), and LogCategory::thresholdPriority.

void _log_logEvent ( struct LogCategory category,
struct LogEvent ev,
  ... 
)

Definition at line 92 of file log4c.c.

References LogEvent::ap, LogCategory::appender, LogAppender::doAppend, LogCategory::parent, and LogCategory::willLogToParent.

struct LogCategory _LOGV ( LOG_ROOT_CAT   )  [read]

void log_setAppender ( struct LogCategory cat,
struct LogAppender app 
)

Sets the category's appender.

Definition at line 190 of file log4c.c.

References LogCategory::appender.

void log_setParent ( struct LogCategory cat,
struct LogCategory parent 
)

Programatically alter a category's parent.

Definition at line 133 of file log4c.c.

References LogCategory::firstChild, initCategory(), LogCategory::isThreshInherited, LP_UNINITIALIZED, LogCategory::nextSibling, LogCategory::parent, and LogCategory::thresholdPriority.

void log_setThreshold ( struct LogCategory cat,
int  thresholdPriority 
)

Programatically alters a category's threshold priority.

Definition at line 173 of file log4c.c.

References LogCategory::isThreshInherited, setInheritedThresholds(), and LogCategory::thresholdPriority.


Variable Documentation

struct LogAppender* log_defaultLogAppender

Definition at line 55 of file log_default.c.

Referenced by initCategory().


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