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)
67 #ifdef LOG_TO_CALLBACK
68 #define CSYNC_LOG(priority, ...) \
69 csync_log_cb((char *) CSYNC_LOG_CATEGORY_NAME, priority, __VA_ARGS__)
71 #define CSYNC_LOG(priority, ...) \
72 csync_log((char *) CSYNC_LOG_CATEGORY_NAME, priority, __VA_ARGS__)
76 #define CSYNC_LOG_PRIORITY_FATAL LOG4C_PRIORITY_FATAL
77 #define CSYNC_LOG_PRIORITY_ALERT LOG4C_PRIORITY_ALERT
78 #define CSYNC_LOG_PRIORITY_CRIT LOG4C_PRIORITY_CRIT
79 #define CSYNC_LOG_PRIORITY_ERROR LOG4C_PRIORITY_ERROR
80 #define CSYNC_LOG_PRIORITY_WARN LOG4C_PRIORITY_WARN
81 #define CSYNC_LOG_PRIORITY_NOTICE LOG4C_PRIORITY_NOTICE
82 #define CSYNC_LOG_PRIORITY_INFO LOG4C_PRIORITY_INFO
83 #define CSYNC_LOG_PRIORITY_DEBUG LOG4C_PRIORITY_DEBUG
84 #define CSYNC_LOG_PRIORITY_TRACE LOG4C_PRIORITY_TRACE
85 #define CSYNC_LOG_PRIORITY_NOTSET LOG4C_PRIORITY_NOTSET
86 #define CSYNC_LOG_PRIORITY_UNKNOWN LOG4C_PRIORITY_UNKNOWN
88 #define LOG4C_INLINE inline
89 #define CSYNC_LOG_PRIORITY_FATAL 000
90 #define CSYNC_LOG_PRIORITY_ALERT 100
91 #define CSYNC_LOG_PRIORITY_CRIT 200
92 #define CSYNC_LOG_PRIORITY_ERROR 300
93 #define CSYNC_LOG_PRIORITY_WARN 500
94 #define CSYNC_LOG_PRIORITY_NOTICE 500
95 #define CSYNC_LOG_PRIORITY_INFO 600
96 #define CSYNC_LOG_PRIORITY_DEBUG 700
97 #define CSYNC_LOG_PRIORITY_TRACE 800
98 #define CSYNC_LOG_PRIORITY_NOTSET 900
99 #define CSYNC_LOG_PRIORITY_UNKNOWN 1000
126 return log4c_load(path);
150 log4c_category_set_appender(log4c_category_get(catName),
151 log4c_appender_get(appName));
154 if (catName == NULL || appName == NULL) {
162 const char* a_format,...) {
164 const log4c_category_t* a_category = log4c_category_get(catName);
165 if (log4c_category_is_priority_enabled(a_category, a_priority)) {
167 va_start(va, a_format);
168 log4c_category_vlog(a_category, a_priority, a_format, va);
177 va_start(va, a_format);
178 if (a_priority > 0) {
179 printf(
"%s - ", catName);
181 vprintf(a_format, va);