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 LogAppender * | log_defaultLogAppender |
#define _LOG_ISENABLEDV | ( | catv, | |||
priority | ) |
Value:
(priority >= LOG_STATIC_THRESHOLD \ && priority >= (catv).thresholdPriority \ && ((catv).thresholdPriority != LP_UNINITIALIZED \ || _log_initCat(priority, &(catv))) )
NOTES First part is a compile-time constant. Call to _log_initCat only happens once.
#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
#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 | ( | 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 CRITICAL1 | ( | f | ) | _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 |
#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 DEBUG1 | ( | f | ) | _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 |
#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 |
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 |
#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 LOG_DEFAULT_CATEGORY | ( | cname | ) | static struct LogCategory* _log_defaultCategory = &_LOGV(cname); |
#define LOG_EXPORT_CATEGORY | ( | catName | ) | extern struct LogCategory _LOGV(catName) |
#define LOG_ISENABLED | ( | catName, | |||
priority | ) | _LOG_ISENABLEDV(_LOGV(catName), priority) |
#define LOG_NEW_CATEGORY | ( | catName | ) | LOG_NEW_SUBCATEGORY(catName, LOG_ROOT_CAT) |
#define LOG_NEW_DEFAULT_CATEGORY | ( | cname | ) |
Value:
LOG_NEW_CATEGORY(cname); \ LOG_DEFAULT_CATEGORY(cname);
#define LOG_NEW_DEFAULT_SUBCATEGORY | ( | cname, | |||
parent | ) |
Value:
LOG_NEW_SUBCATEGORY(cname, parent); \ LOG_DEFAULT_CATEGORY(cname);
#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 \ };
#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 |
#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 |
#define NOTICE1 | ( | f | ) | _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 |
#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 |
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 |
#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 |
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.
struct LogAppender* log_defaultLogAppender |