00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __CALENDAR_SUPPORT_H__
00018 #define __CALENDAR_SUPPORT_H_
00019
00020 #include <syslog.h>
00021 #include <stdlib.h>
00022
00023 #undef DEBUG_LEVEL_1
00024
00025 extern int enable_logging ;
00026
00027
00028
00029 #ifndef NO_DEBUG_MESSAGES_PLEASE
00030 #ifdef DEBUG_LEVEL_1
00031 # define CAL_DEBUG_LOG(a...) ULOG_DEBUG_F(a)
00032 # else
00033 # define CAL_DEBUG_LOG(fmtstr, args...) \
00034 if (enable_logging)\
00035 ( syslog(LOG_ERR,"CALENDAR" ":%s: " fmtstr "\n", __func__, ##args))
00036 # endif
00037 #else
00038 # define CAL_DEBUG_LOG(a...) {;}
00039 #endif
00040
00041
00042 #define CALENDAR_LOG_ERROR(X,Y)\
00043 if(X!=CALENDAR_OPERATION_SUCCESSFUL){\
00044 syslog(LOG_ERR,"Error Code is : %d Error Message : %s",X,Y);\
00045 return FAILURE;\
00046 }
00047
00048
00049 #ifdef DEBUG_LEVEL_2
00050
00051 #define CAL_LOG(ARG...) ULOG_DEBUG_F(ARG)
00052
00053 #else
00054
00055 #define CAL_LOG(ARG...)
00056
00057 #endif
00058
00059 #endif