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);
369 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 3, 4)))
372 const
char* a_format,
377 va_start(va, a_format);
378 log4c_category_vlog(a_category, a_priority, a_format, va);
392 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 4, 5)))
397 const
char* a_format,
402 va_start(va, a_format);
403 __log4c_category_vlog(a_category, a_locinfo, a_priority, a_format, va);
415 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
417 const
char* a_format,
422 va_start(va, a_format);
435 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
437 const
char* a_format,
442 va_start(va, a_format);
455 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
457 const
char* a_format,
462 va_start(va, a_format);
475 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
477 const
char* a_format,
482 va_start(va, a_format);
495 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
497 const
char* a_format,
502 va_start(va, a_format);
515 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
517 const
char* a_format,
522 va_start(va, a_format);
535 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
537 const
char* a_format,
542 va_start(va, a_format);
555 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
557 const
char* a_format,
562 va_start(va, a_format);
575 LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3)))
577 const
char* a_format,
582 va_start(va, a_format);
590 #ifdef OLD_VARIADIC_MACRO 592 # define log4c_category_trace(a_category, a_format, args...) \ 593 __log4c_category_trace(a_category, log4c_location "\n" a_format, ##args ) 597 # define log4c_category_trace(a_category, a_format, ...) \ 598 __log4c_category_trace(a_category, log4c_location "\n" a_format, ##__VA_ARGS__ ) 604 # define log4c_category_trace __log4c_category_trace 614 # define log4c_category_define(a_category, a_name) \ 615 typedef log4c_category_t log4c_category_define_##a_category __attribute__((deprecated)); \ 616 static log4c_category_define_##a_category* a_category __attribute__ ((unused)) = NULL; 618 # define log4c_category_define(a_category, a_name) 625 LOG4C_API
struct __sd_factory* log4c_category_factory;
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:516
static LOG4C_INLINE void log4c_category_log(const log4c_category_t *a_category, int a_priority, const char *a_format,...)
Definition: category.h:370
The internal representation of caller location information.
static int log4c_category_is_crit_enabled(const log4c_category_t *a_category)
Definition: category.h:219
int log4c_category_get_chainedpriority(const log4c_category_t *a_category)
Definition: category.c:122
Definition: priority.h:36
log4c_category_t * log4c_category_get(const char *a_name)
Definition: category.c:50
static LOG4C_INLINE void log4c_category_fatal(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:416
static LOG4C_INLINE void __log4c_category_trace(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:576
static int log4c_category_is_fatal_enabled(const log4c_category_t *a_category)
Definition: category.h:185
Definition: priority.h:29
int log4c_category_set_additivity(log4c_category_t *a_category, int a_additivity)
Definition: category.c:180
static int log4c_category_is_error_enabled(const log4c_category_t *a_category)
Definition: category.h:236
int log4c_category_get_priority(const log4c_category_t *a_category)
Definition: category.c:116
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
int log4c_category_get_additivity(const log4c_category_t *a_category)
Definition: category.c:142
static LOG4C_INLINE void log4c_category_alert(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:436
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:556
Definition: priority.h:32
Definition: priority.h:30
void log4c_category_print(const log4c_category_t *a_category, FILE *a_stream)
Definition: category.c:193
#define LOG4C_LOCATION_INFO_INITIALIZER(user_data)
Definition: location_info.h:54
The priority class provides importance levels with which one can categorize log messages.
const struct __log4c_appender * log4c_category_get_appender(const log4c_category_t *a_category)
Definition: category.c:136
Definition: priority.h:37
static LOG4C_INLINE void log4c_category_error(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:476
const char * log4c_category_get_name(const log4c_category_t *a_category)
Definition: category.c:110
static LOG4C_INLINE void log4c_category_crit(const log4c_category_t *a_category, const char *a_format,...)
Definition: category.h:456
int log4c_category_list(log4c_category_t **a_cats, int a_ncats)
Definition: category.c:67
const struct __log4c_appender * log4c_category_set_appender(log4c_category_t *a_category, struct __log4c_appender *a_appender)
Definition: category.c:165
log4c_category_t * log4c_category_new(const char *a_name)
Definition: category.c:75
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:393
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:536
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:496
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
Definition: priority.h:33
void log4c_category_delete(log4c_category_t *a_category)
Definition: category.c:100
int log4c_category_set_priority(log4c_category_t *a_category, int a_priority)
Definition: category.c:148