csync_log.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _CSYNC_LOG_H
00033 #define _CSYNC_LOG_H
00034
00035
00036 #ifndef PRINTF_ATTRIBUTE
00037 #ifdef __GNUC__
00038 #ifdef _WIN32
00039 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__gnu_printf__, a, b)))
00040 #else
00041 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
00042 #endif
00043 #else
00044 #define PRINTF_ATTRIBUTE(a,b)
00045 #endif
00046 #endif
00047
00048 enum csync_log_priority_e {
00049 CSYNC_LOG_PRIORITY_NOLOG = 0,
00050 CSYNC_LOG_PRIORITY_FATAL,
00051 CSYNC_LOG_PRIORITY_ALERT,
00052 CSYNC_LOG_PRIORITY_CRIT,
00053 CSYNC_LOG_PRIORITY_ERROR,
00054 CSYNC_LOG_PRIORITY_WARN,
00055 CSYNC_LOG_PRIORITY_NOTICE,
00056 CSYNC_LOG_PRIORITY_INFO,
00057 CSYNC_LOG_PRIORITY_DEBUG,
00058 CSYNC_LOG_PRIORITY_TRACE,
00059 CSYNC_LOG_PRIORITY_NOTSET,
00060 CSYNC_LOG_PRIORITY_UNKNOWN,
00061 };
00062
00063 #define CSYNC_LOG(priority, ...) \
00064 csync_log(ctx, priority, __FUNCTION__, __VA_ARGS__)
00065
00066 void csync_log(CSYNC *ctx,
00067 int verbosity,
00068 const char *function,
00069 const char *format, ...) PRINTF_ATTRIBUTE(4, 5);
00070
00071
00072
00073
00074 #endif
00075
00076