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;
LOG4C_API const struct __log4c_appender * log4c_category_get_appender(const log4c_category_t *a_category)
Definition: category.c:134
static int log4c_category_is_debug_enabled(const log4c_category_t *a_category)
Definition: category.h:305
static int log4c_category_is_warn_enabled(const log4c_category_t *a_category)
Definition: category.h:253
static int log4c_category_is_alert_enabled(const log4c_category_t *a_category)
Definition: category.h:202
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
The internal representation of caller location information.
static int log4c_category_is_crit_enabled(const log4c_category_t *a_category)
Definition: category.h:219
LOG4C_API log4c_category_t * log4c_category_new(const char *a_name)
Definition: category.c:73
LOG4C_API int log4c_category_list(log4c_category_t **a_cats, int a_ncats)
Definition: category.c:65
Definition: priority.h:36
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_trace(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:565
static int log4c_category_is_fatal_enabled(const log4c_category_t *a_category)
Definition: category.h:185
Definition: priority.h:29
LOG4C_API int log4c_category_set_additivity(log4c_category_t *a_category, int a_additivity)
Definition: category.c:178
LOG4C_API void log4c_category_print(const log4c_category_t *a_category, FILE *a_stream)
Definition: category.c:191
static int log4c_category_is_error_enabled(const log4c_category_t *a_category)
Definition: category.h:236
LOG4C_API int log4c_category_get_additivity(const log4c_category_t *a_category)
Definition: category.c:140
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
LOG4C_API int log4c_category_get_priority(const log4c_category_t *a_category)
Definition: category.c:114
static LOG4C_INLINE void log4c_category_alert(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:432
Definition: priority.h:34
Definition: priority.h:35
Definition: priority.h:31
static LOG4C_INLINE void log4c_category_debug(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:546
Definition: priority.h:32
Definition: priority.h:30
#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
The priority class provides importance levels with which one can categorize log messages.
Definition: priority.h:37
LOG4C_API int log4c_category_set_priority(log4c_category_t *a_category, int a_priority)
Definition: category.c:146
LOG4C_API const char * log4c_category_get_name(const log4c_category_t *a_category)
Definition: category.c:108
LOG4C_API int log4c_category_get_chainedpriority(const log4c_category_t *a_category)
Definition: category.c:120
static LOG4C_INLINE void log4c_category_error(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:470
static LOG4C_INLINE void log4c_category_crit(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:451
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
static int log4c_category_is_notice_enabled(const log4c_category_t *a_category)
Definition: category.h:271
static LOG4C_INLINE void log4c_category_info(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:527
logging location information
Definition: location_info.h:39
static LOG4C_INLINE void log4c_category_warn(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:489
static int log4c_category_is_trace_enabled(const log4c_category_t *a_category)
Definition: category.h:322
struct __log4c_category log4c_category_t
Definition: category.h:37
LOG4C_API void log4c_category_delete(log4c_category_t *a_category)
Definition: category.c:98
Definition: priority.h:33
LOG4C_API const struct __log4c_appender * log4c_category_set_appender(log4c_category_t *a_category, struct __log4c_appender *a_appender)
Definition: category.c:163