log4c
1.2.4
|
central class in the log4c package. More...
#include <stdio.h>
#include <stdarg.h>
#include <log4c/defs.h>
#include <log4c/priority.h>
#include <log4c/location_info.h>
Go to the source code of this file.
Macros | |
#define | log4c_category_define(a_category, a_name) |
Typedefs | |
typedef struct __log4c_category | log4c_category_t |
Functions | |
log4c_category_t * | log4c_category_get (const char *a_name) |
int | log4c_category_list (log4c_category_t **a_cats, int a_ncats) |
log4c_category_t * | log4c_category_new (const char *a_name) |
void | log4c_category_delete (log4c_category_t *a_category) |
const char * | log4c_category_get_name (const log4c_category_t *a_category) |
struct __log4c_appender * | log4c_category_get_appender (const log4c_category_t *a_category) |
int | log4c_category_get_additivity (const log4c_category_t *a_category) |
int | log4c_category_get_priority (const log4c_category_t *a_category) |
int | log4c_category_get_chainedpriority (const log4c_category_t *a_category) |
struct __log4c_appender * | log4c_category_set_appender (log4c_category_t *a_category, struct __log4c_appender *a_appender) |
int | log4c_category_set_priority (log4c_category_t *a_category, int a_priority) |
int | log4c_category_set_additivity (log4c_category_t *a_category, int a_additivity) |
void | log4c_category_print (const log4c_category_t *a_category, FILE *a_stream) |
static int | log4c_category_is_priority_enabled (const log4c_category_t *a_category, int a_priority) |
static int | log4c_category_is_fatal_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_alert_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_crit_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_error_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_warn_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_notice_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_info_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_debug_enabled (const log4c_category_t *a_category) |
static int | log4c_category_is_trace_enabled (const log4c_category_t *a_category) |
static LOG4C_INLINE void | log4c_category_log (const log4c_category_t *a_category, int a_priority, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_log_locinfo (const log4c_category_t *a_category, const log4c_location_info_t *a_locinfo, int a_priority, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_fatal (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_alert (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_crit (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_error (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_warn (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_notice (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_info (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | log4c_category_debug (const log4c_category_t *a_category, const char *a_format,...) |
static LOG4C_INLINE void | __log4c_category_trace (const log4c_category_t *a_category, const char *a_format,...) |
central class in the log4c package.
One of the distintive features of log4j (and hence log4c) are hierarchical categories and their evaluation.
#define log4c_category_define | ( | a_category, | |
a_name | |||
) |
Helper macro to define static categories.
a_category | the log4c_category_t pointer name |
a_name | the category name |
typedef struct __log4c_category log4c_category_t |
log4c category class
|
static |
Log a message with trace priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_TRACE.
|
static |
Log a message with alert priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ALERT.
|
static |
Log a message with crit priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_CRIT.
|
static |
Log a message with debug priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_DEBUG.
void log4c_category_delete | ( | log4c_category_t * | a_category | ) |
Destructor for a log4c_category_t.
a_category | the log4c_category_t object |
|
static |
Log a message with error priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ERROR.
|
static |
Log a message with fatal priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_FATAL.
log4c_category_t* log4c_category_get | ( | const char * | a_name | ) |
Instantiate a log4c_category_t with name name. This method does not set priority of the category which is by default LOG4C_PRIORITY_NOTSET
.
a_name | The name of the category to retrieve. |
int log4c_category_get_additivity | ( | const log4c_category_t * | a_category | ) |
Get the additivity flag for this log4c_category_t..
a_category | the log4c_category_t object |
|
read |
Returns the Appender for this log4c_category_t, or NULL if no Appender has been set.
a_category | the log4c_category_t object |
int log4c_category_get_chainedpriority | ( | const log4c_category_t * | a_category | ) |
Starting from this category, search the category hierarchy for a set priority and return it. Otherwise, return the priority of the root category.
a_category | the log4c_category_t object |
References LOG4C_PRIORITY_NOTSET, and LOG4C_PRIORITY_UNKNOWN.
const char* log4c_category_get_name | ( | const log4c_category_t * | a_category | ) |
Return the category name.
a_category | the log4c_category_t object |
int log4c_category_get_priority | ( | const log4c_category_t * | a_category | ) |
Returns the assigned Priority, if any, for this log4c_category_t.
a_category | the log4c_category_t object |
References LOG4C_PRIORITY_UNKNOWN.
|
static |
Log a message with info priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_INFO.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_ALERT
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ALERT.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_CRIT
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_CRIT.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_DEBUG
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_DEBUG.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_ERROR
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ERROR.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_FATAL
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_FATAL.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_INFO
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_INFO.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_NOTICE
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_NOTICE.
|
inlinestatic |
Returns true if the chained priority of the log4c_category_t is equal to or higher than given priority.
a_category | the log4c_category_t object |
a_priority | The priority to compare with. |
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_TRACE
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_TRACE.
|
inlinestatic |
Return true if the category will log messages with priority LOG4C_PRIORITY_WARN
.
a_category | the log4c_category_t object |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_WARN.
int log4c_category_list | ( | log4c_category_t ** | a_cats, |
int | a_ncats | ||
) |
Fill in an array with the log4c categories.
a_cats | array of categories that will be filled |
a_ncats | number of categories in the array |
|
static |
Log a message with the specified priority.
a_category | the log4c_category_t object |
a_priority | The priority of this log message. |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled().
|
static |
Log a message with the specified priority and a user location info.
a_category | the log4c_category_t object |
a_locinfo | a user location info |
a_priority | The priority of this log message. |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled().
log4c_category_t* log4c_category_new | ( | const char * | a_name | ) |
Constructor for a log4c_category_t.
a_name | the category name |
References LOG4C_PRIORITY_NOTSET.
|
static |
Log a message with notice priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_NOTICE.
void log4c_category_print | ( | const log4c_category_t * | a_category, |
FILE * | a_stream | ||
) |
prints the log4c_category_t object on a stream
a_category | the log4c_category_t object |
a_stream | The stream |
int log4c_category_set_additivity | ( | log4c_category_t * | a_category, |
int | a_additivity | ||
) |
Sets a new additivity flag for this category.
a_category | the log4c_category_t object |
a_additivity | the new category additivity |
|
read |
Sets a new appender for this category.
a_category | the log4c_category_t object |
a_appender | the new category appender |
int log4c_category_set_priority | ( | log4c_category_t * | a_category, |
int | a_priority | ||
) |
Sets a new priority of this category.
a_category | the log4c_category_t object |
a_priority | the new priority to set. Use LOG4C_PRIORITY_NOTSET to let the category use its parents priority as effective priority. |
References LOG4C_PRIORITY_UNKNOWN.
|
static |
Log a message with warn priority.
a_category | the log4c_category_t object |
a_format | Format specifier for the string to write in the log file. |
... | The arguments for a_format |
References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_WARN.