Go to the documentation of this file.
10 #ifndef log4c_category_h
11 #define log4c_category_h
25 #include <log4c/defs.h>
31 struct __log4c_appender;
32 struct __log4c_category;
130 struct __log4c_appender* a_appender);
166 #if !defined(_WIN32) && !defined(__HP_cc)
173 #define log4c_category_is_priority_enabled(a,b) \
174 (log4c_category_get_chainedpriority(a) >= b)
184 #if !defined(_WIN32) && !defined(__HP_cc)
190 #define log4c_category_is_fatal_enabled(a) \
191 (log4c_category_is_priority_enabled(a,LOG4C_PRIORITY_FATAL))
201 #if !defined(_WIN32) && !defined(__HP_cc)
207 #define log4c_category_is_alert_enabled(a) \
208 (log4c_category_is_priority_enabled(a,LOG4C_PRIORITY_ALERT))
218 #if !defined(_WIN32) && !defined(__HP_cc)
224 #define log4c_category_is_crit_enabled(a) \
225 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_CRIT))
235 #if !defined(_WIN32) && !defined(__HP_cc)
241 #define log4c_category_is_error_enabled(a) \
242 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_ERROR))
252 #if !defined(_WIN32) && !defined(__HP_cc)
258 #define log4c_category_is_warn_enabled(a) \
259 log4c_category_is_warn_enabled(a) \
260 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_WARN))
270 #if !defined(_WIN32) && !defined(__HP_cc)
276 #define log4c_category_is_notice_enabled(a) \
277 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_NOTICE))
287 #if !defined(_WIN32) && !defined(__HP_cc)
293 #define log4c_category_is_info_enabled(a) \
294 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_INFO))
304 #if !defined(_WIN32) && !defined(__HP_cc)
310 #define log4c_category_is_debug_enabled(a) \
311 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_DEBUG))
321 #if !defined(_WIN32) && !defined(__HP_cc)
327 #define log4c_category_is_trace_enabled(a) \
328 (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_TRACE))
337 const char* a_format,
351 static LOG4C_INLINE
void log4c_category_vlog(
const log4c_category_t* a_category,
353 const char* a_format,
358 __log4c_category_vlog(a_category, &locinfo, a_priority, a_format, a_args);
371 const char* a_format,
376 va_start(va, a_format);
377 log4c_category_vlog(a_category, a_priority, a_format, va);
395 const char* a_format,
400 va_start(va, a_format);
401 __log4c_category_vlog(a_category, a_locinfo, a_priority, a_format, va);
414 const char* a_format,
419 va_start(va, a_format);
433 const char* a_format,
438 va_start(va, a_format);
452 const char* a_format,
457 va_start(va, a_format);
471 const char* a_format,
476 va_start(va, a_format);
490 const char* a_format,
495 va_start(va, a_format);
509 const char* a_format,
514 va_start(va, a_format);
528 const char* a_format,
533 va_start(va, a_format);
547 const char* a_format,
552 va_start(va, a_format);
566 const char* a_format,
571 va_start(va, a_format);
579 #ifdef OLD_VARIADIC_MACRO
581 # define log4c_category_trace(a_category, a_format, args...) \
582 __log4c_category_trace(a_category, log4c_location "\n" a_format, ##args )
586 # define log4c_category_trace(a_category, a_format, ...) \
587 __log4c_category_trace(a_category, log4c_location "\n" a_format, ##__VA_ARGS__ )
593 # define log4c_category_trace __log4c_category_trace
603 # define log4c_category_define(a_category, a_name) \
604 typedef log4c_category_t log4c_category_define_##a_category __attribute__((deprecated)); \
605 static log4c_category_define_##a_category* a_category __attribute__ ((unused)) = NULL;
607 # define log4c_category_define(a_category, a_name)
614 LOG4C_API
struct __sd_factory* log4c_category_factory;
static LOG4C_INLINE void log4c_category_alert(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:432
the internal representation of logging events.
central class in the log4c package.
static LOG4C_INLINE void log4c_category_fatal(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:413
static LOG4C_INLINE void log4c_category_info(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:527
The internal representation of caller location information.
LOG4C_API log4c_rc_t *const log4c_rc
Definition: rc.h:49
static int log4c_category_is_notice_enabled(const log4c_category_t *a_category)
Definition: category.h:271
struct __log4c_appender log4c_appender_t
Definition: appender.h:34
@ LOG4C_PRIORITY_UNKNOWN
Definition: priority.h:39
LOG4C_API void log4c_category_delete(log4c_category_t *a_category)
Definition: category.c:98
LOG4C_API void log4c_category_print(const log4c_category_t *a_category, FILE *a_stream)
Definition: category.c:191
LOG4C_API const struct __log4c_appender * log4c_category_set_appender(log4c_category_t *a_category, struct __log4c_appender *a_appender)
Definition: category.c:163
LOG4C_API int log4c_category_set_priority(log4c_category_t *a_category, int a_priority)
Definition: category.c:146
The priority class provides importance levels with which one can categorize log messages.
log4c resource configuration
@ LOG4C_PRIORITY_FATAL
Definition: priority.h:29
static int log4c_category_is_alert_enabled(const log4c_category_t *a_category)
Definition: category.h:202
static int log4c_category_is_warn_enabled(const log4c_category_t *a_category)
Definition: category.h:253
@ LOG4C_PRIORITY_NOTSET
Definition: priority.h:38
LOG4C_API log4c_category_t * log4c_category_new(const char *a_name)
Definition: category.c:73
static LOG4C_INLINE void log4c_category_error(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:470
LOG4C_API int log4c_appender_append(log4c_appender_t *a_appender, log4c_logging_event_t *a_event)
Definition: appender.c:254
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,...)
Definition: category.h:391
@ LOG4C_PRIORITY_WARN
Definition: priority.h:33
static int log4c_category_is_trace_enabled(const log4c_category_t *a_category)
Definition: category.h:322
const LOG4C_API char * log4c_category_get_name(const log4c_category_t *a_category)
Definition: category.c:108
@ LOG4C_PRIORITY_CRIT
Definition: priority.h:31
static LOG4C_INLINE void __log4c_category_trace(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:565
static int log4c_category_is_debug_enabled(const log4c_category_t *a_category)
Definition: category.h:305
struct __log4c_category log4c_category_t
Definition: category.h:37
@ LOG4C_PRIORITY_ERROR
Definition: priority.h:32
@ LOG4C_PRIORITY_NOTICE
Definition: priority.h:34
LOG4C_API const struct __log4c_appender * log4c_category_get_appender(const log4c_category_t *a_category)
Definition: category.c:134
const LOG4C_API char * log4c_appender_get_name(const log4c_appender_t *a_appender)
Definition: appender.c:155
LOG4C_API int log4c_category_list(log4c_category_t **a_cats, int a_ncats)
Definition: category.c:65
const LOG4C_API char * log4c_priority_to_string(int a_priority)
Definition: priority.c:32
static LOG4C_INLINE void log4c_category_notice(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:508
static LOG4C_INLINE void log4c_category_log(const log4c_category_t *a_category, int a_priority, const char *a_format,...)
Definition: category.h:369
static LOG4C_INLINE void log4c_category_crit(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:451
@ LOG4C_PRIORITY_DEBUG
Definition: priority.h:36
static LOG4C_INLINE void log4c_category_debug(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:546
logging event object
Definition: logging_event.h:49
static LOG4C_INLINE void log4c_category_warn(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:489
LOG4C_API int log4c_category_set_additivity(log4c_category_t *a_category, int a_additivity)
Definition: category.c:178
static int log4c_category_is_fatal_enabled(const log4c_category_t *a_category)
Definition: category.h:185
@ LOG4C_PRIORITY_INFO
Definition: priority.h:35
@ LOG4C_PRIORITY_TRACE
Definition: priority.h:37
@ LOG4C_PRIORITY_ALERT
Definition: priority.h:30
static int log4c_category_is_error_enabled(const log4c_category_t *a_category)
Definition: category.h:236
Implement this interface for your own strategies for printing log statements.
LOG4C_API int log4c_category_get_additivity(const log4c_category_t *a_category)
Definition: category.c:140
#define LOG4C_LOCATION_INFO_INITIALIZER(user_data)
Definition: location_info.h:54
LOG4C_API log4c_category_t * log4c_category_get(const char *a_name)
Definition: category.c:48
LOG4C_API int log4c_category_get_priority(const log4c_category_t *a_category)
Definition: category.c:114
LOG4C_API int log4c_category_get_chainedpriority(const log4c_category_t *a_category)
Definition: category.c:120
static int log4c_category_is_info_enabled(const log4c_category_t *a_category)
Definition: category.h:288
static int log4c_category_is_priority_enabled(const log4c_category_t *a_category, int a_priority)
Definition: category.h:167
static int log4c_category_is_crit_enabled(const log4c_category_t *a_category)
Definition: category.h:219
logging location information
Definition: location_info.h:39