00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00035 #ifndef _ER_REGISTRY_LOG_H_
00036 #define _ER_REGISTRY_LOG_H_
00037
00038
00039
00040 #define ERREG_BASIS_LOG_ON 0
00041 #define ERREG_BASIS_WARN_ON 1
00042 #define ERREG_BASIS_ERROR_ON 1
00043
00044 #define ERREG_NWPROFILES_LOG_ON 0
00045 #define ERREG_NWPROFILES_WARN_ON 1
00046 #define ERREG_NWPROFILES_ERROR_ON 1
00047
00048 #define ERREG_TOOLBAR_LOG_ON 0
00049 #define ERREG_TOOLBAR_WARN_ON 1
00050 #define ERREG_TOOLBAR_ERROR_ON 1
00051
00052 #define ERREG_LOGGING_ON 0
00053 #define ERREG_WARNING_ON 1
00054 #define ERREG_ERROR_ON 1
00055
00056 #define ERREG_XSD_LOG_ON 0
00057 #define ERREG_XSD_WARN_ON 1
00058 #define ERREG_XSD_ERROR_ON 1
00059
00060 #define ERREG_CFG_LOG_ON 0
00061 #define ERREG_CFG_WARN_ON 1
00062 #define ERREG_CFG_ERROR_ON 1
00063
00064 #define ERREG_RWLOCK_LOG_ON 0
00065 #define ERREG_RWLOCK_WARN_ON 1
00066 #define ERREG_RWLOCK_ERROR_ON 1
00067
00068 #define ERREG_DUMP_ON 0
00069
00070 #define ERREG_TIME_ON 0
00071
00072 #if (ERREG_BASIS_LOG_ON)
00073 #define ERREG_BASIS_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00074 #else
00075 #define ERREG_BASIS_LOGPRINTF(x, args...) do {} while (0)
00076 #endif
00077
00078 #if (ERREG_BASIS_WARN_ON)
00079 #define ERREG_BASIS_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00080 #else
00081 #define ERREG_BASIS_WARNPRINTF(x, args...) do {} while (0)
00082 #endif
00083
00084 #if (ERREG_BASIS_ERROR_ON)
00085 #define ERREG_BASIS_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00086 #else
00087 #define ERREG_BASIS_ERRORPRINTF(x, args...) do {} while (0)
00088 #endif
00089
00090 #if (ERREG_TOOLBAR_LOG_ON)
00091 #define ERREG_TOOLBAR_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00092 #else
00093 #define ERREG_TOOLBAR_LOGPRINTF(x, args...) do {} while (0)
00094 #endif
00095
00096 #if (ERREG_TOOLBAR_WARN_ON)
00097 #define ERREG_TOOLBAR_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00098 #else
00099 #define ERREG_TOOLBAR_WARNPRINTF(x, args...) do {} while (0)
00100 #endif
00101
00102 #if (ERREG_TOOLBAR_ERROR_ON)
00103 #define ERREG_TOOLBAR_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00104 #else
00105 #define ERREG_TOOLBAR_ERRORPRINTF(x, args...) do {} while (0)
00106 #endif
00107
00108 #if (ERREG_NWPROFILES_LOG_ON)
00109 #define ERREG_NWPROFILES_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00110 #else
00111 #define ERREG_NWPROFILES_LOGPRINTF(x, args...) do {} while (0)
00112 #endif
00113
00114 #if (ERREG_NWPROFILES_WARN_ON)
00115 #define ERREG_NWPROFILES_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00116 #else
00117 #define ERREG_NWPROFILES_WARNPRINTF(x, args...) do {} while (0)
00118 #endif
00119
00120 #if (ERREG_NWPROFILES_ERROR_ON)
00121 #define ERREG_NWPROFILES_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00122 #else
00123 #define ERREG_NWPROFILES_ERRORPRINTF(x, args...) do {} while (0)
00124 #endif
00125
00126 #if (ERREG_LOGGING_ON)
00127 #define ERREG_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00128 #else
00129 #define ERREG_LOGPRINTF(x, args...) do {} while (0)
00130 #endif
00131
00132 #if (ERREG_WARNING_ON)
00133 #define ERREG_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00134 #else
00135 #define ERREG_WARNPRINTF(x, args...) do {} while (0)
00136 #endif
00137
00138 #if (ERREG_ERROR_ON)
00139 #define ERREG_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00140 #else
00141 #define ERREG_ERRORPRINTF(x, args...) do {} while (0)
00142 #endif
00143
00144 #if (ERREG_XSD_LOG_ON)
00145 #define ERREG_XSD_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00146 #else
00147 #define ERREG_XSD_LOGPRINTF(x, args...) do {} while (0)
00148 #endif
00149
00150 #if (ERREG_XSD_WARN_ON)
00151 #define ERREG_XSD_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00152 #else
00153 #define ERREG_XSD_WARNPRINTF(x, args...) do {} while (0)
00154 #endif
00155
00156 #if (ERREG_XSD_ERROR_ON)
00157 #define ERREG_XSD_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00158 #else
00159 #define ERREG_XSD_ERRORPRINTF(x, args...) do {} while (0)
00160 #endif
00161
00162 #if (ERREG_CFG_LOG_ON)
00163 #define ERREG_CFG_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00164 #else
00165 #define ERREG_CFG_LOGPRINTF(x, args...) do {} while (0)
00166 #endif
00167
00168 #if (ERREG_CFG_WARN_ON)
00169 #define ERREG_CFG_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00170 #else
00171 #define ERREG_CFG_WARNPRINTF(x, args...) do {} while (0)
00172 #endif
00173
00174 #if (ERREG_CFG_ERROR_ON)
00175 #define ERREG_CFG_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00176 #else
00177 #define ERREG_CFG_ERRORPRINTF(x, args...) do {} while (0)
00178 #endif
00179
00180 #if (ERREG_RWLOCK_LOG_ON)
00181 #define ERREG_RWLOCK_LOGPRINTF(x, args...) fprintf(stderr, "(L)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00182 #else
00183 #define ERREG_RWLOCK_LOGPRINTF(x, args...) do {} while (0)
00184 #endif
00185
00186 #if (ERREG_RWLOCK_WARN_ON)
00187 #define ERREG_RWLOCK_WARNPRINTF(x, args...) fprintf(stderr, "(W)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00188 #else
00189 #define ERREG_RWLOCK_WARNPRINTF(x, args...) do {} while (0)
00190 #endif
00191
00192 #if (ERREG_RWLOCK_ERROR_ON)
00193 #define ERREG_RWLOCK_ERRORPRINTF(x, args...) fprintf(stderr, "(E)" __FILE__ ":%d,%s() " x "\n", __LINE__, __func__ , ##args)
00194 #else
00195 #define ERREG_RWLOCK_ERRORPRINTF(x, args...) do {} while (0)
00196 #endif
00197
00198 #if (ERREG_DUMP_ON)
00199 #define ERREG_DUMPPRINTF(x, args...) fprintf(stderr, x "\n", ##args)
00200 #else
00201 #define ERREG_DUMPPRINTF(x, args...) do {} while (0)
00202 #endif
00203
00204 #if (ERREG_TIME_ON)
00205 #include <sys/time.h>
00206 #include <time.h>
00207 #include <glib.h>
00208 #define ERREG_TIMEDISPLAY(x, args...) \
00209 {\
00210 struct timeval now;\
00211 gettimeofday(&now, NULL);\
00212 fprintf(stderr, "(L)" __FILE__ ":%d,%s() " "%ld.%06ld: " x "\n", __LINE__, __func__ , now.tv_sec, now.tv_usec, ##args);\
00213 }
00214 #else
00215 #define ERREG_TIMEDISPLAY(x, args...) do {} while (0)
00216 #endif
00217
00218 #endif //_ER_REGISTRY_LOG_H_