48 #ifndef CSYNC_LOG_CATEGORY_NAME
49 #define CSYNC_LOG_CATEGORY_NAME "root"
54 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
56 #define PRINTF_ATTRIBUTE(a,b)
59 #define CSYNC_LOG(priority, fmt, ...) \
60 csync_log((char *) CSYNC_LOG_CATEGORY_NAME, priority, fmt, ## __VA_ARGS__)
63 #define CSYNC_LOG_PRIORITY_FATAL LOG4C_PRIORITY_FATAL
64 #define CSYNC_LOG_PRIORITY_ALERT LOG4C_PRIORITY_ALERT
65 #define CSYNC_LOG_PRIORITY_CRIT LOG4C_PRIORITY_CRIT
66 #define CSYNC_LOG_PRIORITY_ERROR LOG4C_PRIORITY_ERROR
67 #define CSYNC_LOG_PRIORITY_WARN LOG4C_PRIORITY_WARN
68 #define CSYNC_LOG_PRIORITY_NOTICE LOG4C_PRIORITY_NOTICE
69 #define CSYNC_LOG_PRIORITY_INFO LOG4C_PRIORITY_INFO
70 #define CSYNC_LOG_PRIORITY_DEBUG LOG4C_PRIORITY_DEBUG
71 #define CSYNC_LOG_PRIORITY_TRACE LOG4C_PRIORITY_TRACE
72 #define CSYNC_LOG_PRIORITY_NOTSET LOG4C_PRIORITY_NOTSET
73 #define CSYNC_LOG_PRIORITY_UNKNOWN LOG4C_PRIORITY_UNKNOWN
75 #define LOG4C_INLINE inline
76 #define CSYNC_LOG_PRIORITY_FATAL 000
77 #define CSYNC_LOG_PRIORITY_ALERT 100
78 #define CSYNC_LOG_PRIORITY_CRIT 200
79 #define CSYNC_LOG_PRIORITY_ERROR 300
80 #define CSYNC_LOG_PRIORITY_WARN 500
81 #define CSYNC_LOG_PRIORITY_NOTICE 500
82 #define CSYNC_LOG_PRIORITY_INFO 600
83 #define CSYNC_LOG_PRIORITY_DEBUG 700
84 #define CSYNC_LOG_PRIORITY_TRACE 800
85 #define CSYNC_LOG_PRIORITY_NOTSET 900
86 #define CSYNC_LOG_PRIORITY_UNKNOWN 1000
113 return log4c_load(path);
137 log4c_category_set_appender(log4c_category_get(catName),
138 log4c_appender_get(appName));
141 if (catName == NULL || appName == NULL) {
149 const char* a_format,...) {
151 const log4c_category_t* a_category = log4c_category_get(catName);
152 if (log4c_category_is_priority_enabled(a_category, a_priority)) {
154 va_start(va, a_format);
155 log4c_category_vlog(a_category, a_priority, a_format, va);
160 va_start(va, a_format);
161 if (a_priority > 0) {
162 printf(
"%s - ", catName);
164 vprintf(a_format, va);